Skip to content
Open
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
8 changes: 5 additions & 3 deletions benches/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ impl std::fmt::Write for BlackBoxWrite {

pub fn encode_date(c: &mut Criterion) {
c.bench_function("encode_date", |b| {
let d = "Wed, 21 Oct 2015 07:28:00 GMT";
black_box(httpdate::parse_http_date(d)).unwrap();
let d = "Wed, 21 Oct 2015 07:28:00 GMT"
.parse::<httpdate::HttpDate>()
.unwrap();

b.iter(|| {
use std::fmt::Write;
let _ = write!(BlackBoxWrite, "{}", d);
let _ = write!(BlackBoxWrite, "{}", black_box(d));
})
});
}
Expand Down