diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
commit | ef24de24a82fe681581cc130f342363c47c0969a (patch) | |
tree | 0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/tinystr/benches | |
parent | Releasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip |
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/tinystr/benches/common/mod.rs | 24 | ||||
-rw-r--r-- | vendor/tinystr/benches/construct.rs | 24 | ||||
-rw-r--r-- | vendor/tinystr/benches/overview.rs | 74 |
3 files changed, 0 insertions, 122 deletions
diff --git a/vendor/tinystr/benches/common/mod.rs b/vendor/tinystr/benches/common/mod.rs index 07654e1d9..84090b6c2 100644 --- a/vendor/tinystr/benches/common/mod.rs +++ b/vendor/tinystr/benches/common/mod.rs @@ -37,43 +37,19 @@ macro_rules! bench_block { let mut group4 = $c.benchmark_group(&format!("{}/4", $name)); group4.bench_function("String", $action!(String, STRINGS_4)); group4.bench_function("TinyAsciiStr<4>", $action!(TinyAsciiStr<4>, STRINGS_4)); - group4.bench_function( - "tinystr_old::TinyStr4", - $action!(tinystr_old::TinyStr4, STRINGS_4), - ); group4.bench_function("TinyAsciiStr<8>", $action!(TinyAsciiStr<8>, STRINGS_4)); - group4.bench_function( - "tinystr_old::TinyStr8", - $action!(tinystr_old::TinyStr8, STRINGS_4), - ); group4.bench_function("TinyAsciiStr<16>", $action!(TinyAsciiStr<16>, STRINGS_4)); - group4.bench_function( - "tinystr_old::TinyStr16", - $action!(tinystr_old::TinyStr16, STRINGS_4), - ); group4.finish(); let mut group8 = $c.benchmark_group(&format!("{}/8", $name)); group8.bench_function("String", $action!(String, STRINGS_8)); group8.bench_function("TinyAsciiStr<8>", $action!(TinyAsciiStr<8>, STRINGS_8)); group8.bench_function("TinyAsciiStr<16>", $action!(TinyAsciiStr<16>, STRINGS_8)); - group8.bench_function( - "tinystr_old::TinyStr8", - $action!(tinystr_old::TinyStr8, STRINGS_8), - ); - group8.bench_function( - "tinystr_old::TinyStr16", - $action!(tinystr_old::TinyStr16, STRINGS_8), - ); group8.finish(); let mut group16 = $c.benchmark_group(&format!("{}/16", $name)); group16.bench_function("String", $action!(String, STRINGS_16)); group16.bench_function("TinyAsciiStr<16>", $action!(TinyAsciiStr<16>, STRINGS_16)); - group16.bench_function( - "tinystr_old::TinyStr16", - $action!(tinystr_old::TinyStr16, STRINGS_16), - ); group16.finish(); }; } diff --git a/vendor/tinystr/benches/construct.rs b/vendor/tinystr/benches/construct.rs index 145e721e1..19b18121f 100644 --- a/vendor/tinystr/benches/construct.rs +++ b/vendor/tinystr/benches/construct.rs @@ -47,41 +47,17 @@ fn construct_from_bytes(c: &mut Criterion) { let mut group4 = c.benchmark_group("construct_from_bytes/4"); group4.bench_function("TinyAsciiStr<4>", cfu!(TinyAsciiStr<4>, STRINGS_4)); - group4.bench_function( - "tinystr_old::TinyStr4", - cfu!(tinystr_old::TinyStr4, STRINGS_4), - ); group4.bench_function("TinyAsciiStr<8>", cfu!(TinyAsciiStr<8>, STRINGS_4)); - group4.bench_function( - "tinystr_old::TinyStr8", - cfu!(tinystr_old::TinyStr8, STRINGS_4), - ); group4.bench_function("TinyAsciiStr<16>", cfu!(TinyAsciiStr<16>, STRINGS_4)); - group4.bench_function( - "tinystr_old::TinyStr16", - cfu!(tinystr_old::TinyStr16, STRINGS_4), - ); group4.finish(); let mut group8 = c.benchmark_group("construct_from_bytes/8"); group8.bench_function("TinyAsciiStr<8>", cfu!(TinyAsciiStr<8>, STRINGS_8)); - group8.bench_function( - "tinystr_old::TinyStr8", - cfu!(tinystr_old::TinyStr8, STRINGS_8), - ); group8.bench_function("TinyAsciiStr<16>", cfu!(TinyAsciiStr<16>, STRINGS_8)); - group8.bench_function( - "tinystr_old::TinyStr16", - cfu!(tinystr_old::TinyStr16, STRINGS_8), - ); group8.finish(); let mut group16 = c.benchmark_group("construct_from_bytes/16"); group16.bench_function("TinyAsciiStr<16>", cfu!(TinyAsciiStr<16>, STRINGS_16)); - group16.bench_function( - "tinystr_old::TinyStr16", - cfu!(tinystr_old::TinyStr16, STRINGS_16), - ); group16.finish(); } diff --git a/vendor/tinystr/benches/overview.rs b/vendor/tinystr/benches/overview.rs index 4911832ec..ccdd21ac4 100644 --- a/vendor/tinystr/benches/overview.rs +++ b/vendor/tinystr/benches/overview.rs @@ -11,9 +11,6 @@ use criterion::criterion_main; use criterion::Criterion; use tinystr::TinyAsciiStr; -use tinystr_old::TinyStr16; -use tinystr_old::TinyStr4; -use tinystr_old::TinyStr8; fn overview(c: &mut Criterion) { let mut g = c.benchmark_group("overview"); @@ -35,23 +32,6 @@ fn overview(c: &mut Criterion) { }); }); - g.bench_function("construct/TinyStr", |b| { - b.iter(|| { - for s in STRINGS_4 { - let _: TinyStr4 = black_box(s).parse().unwrap(); - let _: TinyStr8 = black_box(s).parse().unwrap(); - let _: TinyStr16 = black_box(s).parse().unwrap(); - } - for s in STRINGS_8 { - let _: TinyStr8 = black_box(s).parse().unwrap(); - let _: TinyStr16 = black_box(s).parse().unwrap(); - } - for s in STRINGS_16 { - let _: TinyStr16 = black_box(s).parse().unwrap(); - } - }); - }); - let parsed_ascii_4: Vec<TinyAsciiStr<4>> = STRINGS_4 .iter() .map(|s| s.parse::<TinyAsciiStr<4>>().unwrap()) @@ -68,22 +48,6 @@ fn overview(c: &mut Criterion) { .map(|s| s.parse::<TinyAsciiStr<16>>().unwrap()) .collect(); - let parsed_tiny_4: Vec<TinyStr4> = STRINGS_4 - .iter() - .map(|s| s.parse::<TinyStr4>().unwrap()) - .collect(); - let parsed_tiny_8: Vec<TinyStr8> = STRINGS_4 - .iter() - .chain(STRINGS_8) - .map(|s| s.parse::<TinyStr8>().unwrap()) - .collect(); - let parsed_tiny_16: Vec<TinyStr16> = STRINGS_4 - .iter() - .chain(STRINGS_8) - .chain(STRINGS_16) - .map(|s| s.parse::<TinyStr16>().unwrap()) - .collect(); - g.bench_function("read/TinyAsciiStr", |b| { b.iter(|| { let mut collector: usize = 0; @@ -103,25 +67,6 @@ fn overview(c: &mut Criterion) { }); }); - g.bench_function("read/TinyStr", |b| { - b.iter(|| { - let mut collector: usize = 0; - for t in black_box(&parsed_tiny_4) { - let s: &str = t; - collector += s.bytes().map(usize::from).sum::<usize>(); - } - for t in black_box(&parsed_tiny_8) { - let s: &str = t; - collector += s.bytes().map(usize::from).sum::<usize>(); - } - for t in black_box(&parsed_tiny_16) { - let s: &str = t; - collector += s.bytes().map(usize::from).sum::<usize>(); - } - collector - }); - }); - g.bench_function("compare/TinyAsciiStr", |b| { b.iter(|| { let mut collector: usize = 0; @@ -140,25 +85,6 @@ fn overview(c: &mut Criterion) { collector }); }); - - g.bench_function("compare/TinyStr", |b| { - b.iter(|| { - let mut collector: usize = 0; - for ts in black_box(&parsed_tiny_4).windows(2) { - let o = ts[0].cmp(&ts[1]); - collector ^= o as usize; - } - for ts in black_box(&parsed_tiny_8).windows(2) { - let o = ts[0].cmp(&ts[1]); - collector ^= o as usize; - } - for ts in black_box(&parsed_tiny_16).windows(2) { - let o = ts[0].cmp(&ts[1]); - collector ^= o as usize; - } - collector - }); - }); } criterion_group!(benches, overview,); |