Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass image data directly to ZlibStream, bypassing ChunkState::raw_bytes #424

Merged
merged 6 commits into from
Nov 14, 2023
Merged
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
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
Loading