Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 30 additions & 60 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ once_cell = "1.12.0"
[dev-dependencies]
assert_cmd = "2.1.1"
criterion = "0.8"
libflate = "2"
flate2 = "1.1.9"
maplit = "1.0.1"
pretty_assertions = "1"
rand = { version = "0.10", features = ["thread_rng"] }
Expand Down
4 changes: 2 additions & 2 deletions benches/collapse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::fs::File;
use std::io::{self, Read};

use criterion::*;
use flate2::read::GzDecoder;
use inferno::collapse::{dtrace, perf, sample, Collapse};
use libflate::gzip::Decoder;
use once_cell::sync::Lazy;

const INFILE_DTRACE: &str = "flamegraph/example-dtrace-stacks.txt";
Expand All @@ -16,7 +16,7 @@ static NTHREADS: Lazy<usize> = Lazy::new(|| std::thread::available_parallelism()
fn read_infile(infile: &str, buf: &mut Vec<u8>) -> io::Result<()> {
let mut f = File::open(infile)?;
if infile.ends_with(".gz") {
let mut r = io::BufReader::new(Decoder::new(f)?);
let mut r = GzDecoder::new(f);
r.read_to_end(buf)?;
} else {
f.read_to_end(buf)?;
Expand Down
4 changes: 2 additions & 2 deletions src/collapse/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ pub(crate) mod testing {
use std::path::{Path, PathBuf};
use std::time::Instant;

use libflate::gzip::Decoder;
use flate2::read::GzDecoder;

use super::*;
use crate::collapse::Collapse;
Expand All @@ -589,7 +589,7 @@ pub(crate) mod testing {
let mut buf = Vec::new();
let mut file = File::open(path)?;
if path.to_str().unwrap().ends_with(".gz") {
let mut reader = Decoder::new(file)?;
let mut reader = GzDecoder::new(file);
reader.read_to_end(&mut buf)?;
} else {
file.read_to_end(&mut buf)?;
Expand Down
6 changes: 3 additions & 3 deletions tests/common/collapse.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::fs::{self, File};
use std::io::{self, BufRead, BufReader, Cursor};

use flate2::read::GzDecoder;
use inferno::collapse::Collapse;
use libflate::gzip::Decoder;
use pretty_assertions::assert_eq;
use testing_logger::CapturedLog;

Expand Down Expand Up @@ -55,7 +55,7 @@ where
let mut collapse = move |out: &mut dyn io::Write| {
if test_filename.ends_with(".gz") {
let test_file = File::open(test_filename)?;
let r = BufReader::new(Decoder::new(test_file).unwrap());
let r = BufReader::new(GzDecoder::new(test_file));
collapser.collapse(r, out)
} else {
collapser.collapse_file(Some(test_filename), out)
Expand Down Expand Up @@ -123,7 +123,7 @@ where
let mut collapse = move |out: &mut dyn io::Write| {
if test_filename.ends_with(".gz") {
let test_file = File::open(test_filename)?;
let r = BufReader::new(Decoder::new(test_file).unwrap());
let r = BufReader::new(GzDecoder::new(test_file));
collapser.collapse(r, out)
} else {
collapser.collapse_file(Some(test_filename), out)
Expand Down
Loading