Sha256: b6d3e9e5833b53ac58f8336617cc42a2f3f4c5e5ce88feb23184fcdbb36843f6

Contents?: true

Size: 1.02 KB

Versions: 13

Compression:

Stored size: 1.02 KB

Contents

mod parser;
mod parser_streaming;

fn one_test(c: &mut criterion::Criterion) {
    let data = &b"GET / HTTP/1.1
Host: www.reddit.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20100101 Firefox/15.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive

"[..];

    let mut http_group = c.benchmark_group("http");
    http_group.throughput(criterion::Throughput::Bytes(data.len() as u64));
    http_group.bench_with_input(
        criterion::BenchmarkId::new("complete", data.len()),
        data,
        |b, data| {
            b.iter(|| parser::parse(data).unwrap());
        },
    );
    http_group.bench_with_input(
        criterion::BenchmarkId::new("streaming", data.len()),
        data,
        |b, data| {
            b.iter(|| parser_streaming::parse(data).unwrap());
        },
    );

    http_group.finish();
}

criterion::criterion_group!(http, one_test);
criterion::criterion_main!(http);

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/winnow-0.6.24/examples/http/bench.rs
wasmtime-28.0.0 ./ext/cargo-vendor/winnow-0.6.22/examples/http/bench.rs
wasmtime-27.0.0 ./ext/cargo-vendor/winnow-0.6.20/examples/http/bench.rs
wasmtime-26.0.0 ./ext/cargo-vendor/winnow-0.6.20/examples/http/bench.rs
wasmtime-25.0.2 ./ext/cargo-vendor/winnow-0.6.18/examples/http/bench.rs
wasmtime-25.0.1 ./ext/cargo-vendor/winnow-0.6.18/examples/http/bench.rs
wasmtime-25.0.0 ./ext/cargo-vendor/winnow-0.6.18/examples/http/bench.rs
wasmtime-24.0.0 ./ext/cargo-vendor/winnow-0.6.18/examples/http/bench.rs
wasmtime-23.0.2 ./ext/cargo-vendor/winnow-0.6.7/examples/http/bench.rs
wasmtime-22.0.0 ./ext/cargo-vendor/winnow-0.6.7/examples/http/bench.rs
wasmtime-21.0.1 ./ext/cargo-vendor/winnow-0.6.7/examples/http/bench.rs
wasmtime-20.0.2 ./ext/cargo-vendor/winnow-0.6.7/examples/http/bench.rs
wasmtime-20.0.0 ./ext/cargo-vendor/winnow-0.6.7/examples/http/bench.rs