Skip to content

Commit

Permalink
Merge pull request #424 from anforowicz/idat-straight-to-zlibstream
Browse files Browse the repository at this point in the history
Pass image data directly to `ZlibStream`, bypassing `ChunkState::raw_bytes`
  • Loading branch information
fintelia authored Nov 14, 2023
2 parents ec2d257 + e75843f commit 94ef816
Show file tree
Hide file tree
Showing 4 changed files with 332 additions and 101 deletions.
7 changes: 4 additions & 3 deletions benches/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use std::fs;
use criterion::{criterion_group, criterion_main, Criterion, Throughput};
use png::Decoder;

mod png_generator;
#[path = "../src/test_utils.rs"]
mod test_utils;

fn load_all(c: &mut Criterion) {
for entry in fs::read_dir("tests/benches/").unwrap().flatten() {
Expand All @@ -25,11 +26,11 @@ criterion_main!(benches);

fn bench_noncompressed_png(c: &mut Criterion, width: u32) {
let mut data = Vec::new();
png_generator::write_noncompressed_png(&mut data, width);
test_utils::write_noncompressed_png(&mut data, width);
bench_file(
c,
data,
format!("png_generator::noncompressed-{width}x{width}.png"),
format!("generated-png:noncompressed-{width}x{width}.png"),
);
}

Expand Down
Loading

0 comments on commit 94ef816

Please sign in to comment.