From fff851f6c5dc18eebade3b0588edab33fadf7cba Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Sun, 1 Sep 2024 19:01:11 +0300 Subject: [PATCH] benches: lexicographically ordered bench names (#180) zero-pad bench names derived from payload size to improve lexicographic sorting (order matches payload size) --- benches/parse.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/benches/parse.rs b/benches/parse.rs index 775eb89..97a6204 100644 --- a/benches/parse.rs +++ b/benches/parse.rs @@ -124,7 +124,7 @@ fn uri(c: &mut Criterion) { // 1b to 4096b for p in 0..=12 { let n = 1 << p; - _uri(c, &format!("uri_{}b", n), [chunk_4k[..n].to_vec(), S.into()].concat().leak()); + _uri(c, &format!("uri_{:04}b", n), [chunk_4k[..n].to_vec(), S.into()].concat().leak()); } } @@ -148,20 +148,20 @@ fn header(c: &mut Criterion) { for p in 0..=12 { let n = 1 << p; let payload = [&xfoobar_4k[..n], b": b", RNRN].concat().leak(); - _header(c, &format!("name_{}b", n), payload); + _header(c, &format!("name_{:04}b", n), payload); } // header values 1b to 4096b for p in 0..=12 { let n = 1 << p; let payload = [b"a: ", &xfoobar_4k[..n], RNRN].concat().leak(); - _header(c, &format!("value_{}b", n), payload); + _header(c, &format!("value_{:04}b", n), payload); } // 1 to 128 for p in 0..=7 { let n = 1 << p; - _header(c, &format!("count_{}", n), [TINY_RN.repeat(n), RN.into()].concat().leak()); + _header(c, &format!("count_{:03}", n), [TINY_RN.repeat(n), RN.into()].concat().leak()); } }