Unnamed repository; edit this file 'description' to name the repository.
Drop benchmarking
I don't really look at the results of the benchmarks anyway, so having them in the repo creates a false sense of benchmarkdness. If I get to implementing proper benchmarking, I'd probably stay away from criterion -- we need something much much simpler for this crate.
Aleksey Kladov 2020-09-20
parent 6c8f7ce · commit 4ff9ad2
-rw-r--r--lib/smol_str/Cargo.toml5
-rw-r--r--lib/smol_str/benches/building.rs44
2 files changed, 0 insertions, 49 deletions
diff --git a/lib/smol_str/Cargo.toml b/lib/smol_str/Cargo.toml
index 683aeddd55..fee00ec2ba 100644
--- a/lib/smol_str/Cargo.toml
+++ b/lib/smol_str/Cargo.toml
@@ -14,8 +14,3 @@ serde = { version = "1", optional = true, default_features = false, features = [
proptest = "0.10"
serde_json = "1"
serde = { version = "1", features = [ "derive" ] }
-criterion = "0.2"
-
-[[bench]]
-name = "building"
-harness = false
diff --git a/lib/smol_str/benches/building.rs b/lib/smol_str/benches/building.rs
deleted file mode 100644
index 1983314676..0000000000
--- a/lib/smol_str/benches/building.rs
+++ /dev/null
@@ -1,44 +0,0 @@
-#[macro_use]
-extern crate criterion;
-extern crate smol_str;
-
-use criterion::{Criterion, ParameterizedBenchmark, Throughput};
-use smol_str::SmolStr;
-
-fn from_str_iter(c: &mut Criterion) {
- use std::iter::FromIterator;
-
- const SIZES: &[usize] = &[0, 5, 10, 15, 20, 2 << 4, 2 << 5, 2 << 6, 2 << 7, 2 << 8];
-
- fn test_data(input: &str, size: usize) -> Vec<&str> {
- std::iter::repeat(input).take(size / input.len()).collect()
- }
-
- c.bench(
- "FromIterator",
- ParameterizedBenchmark::new(
- "SmolStr, one byte elements",
- |b, &&size| {
- let src = test_data("x", size);
- b.iter(|| SmolStr::from_iter(src.iter().cloned()).len())
- },
- SIZES,
- )
- .with_function("SmolStr, five byte elements", |b, &&size| {
- let src = test_data("helloo", size);
- b.iter(|| SmolStr::from_iter(src.iter().cloned()).len())
- })
- .with_function("String, one byte elements", |b, &&size| {
- let src = test_data("x", size);
- b.iter(|| String::from_iter(src.iter().cloned()).len())
- })
- .with_function("String, five byte elements", |b, &&size| {
- let src = test_data("hello", size);
- b.iter(|| String::from_iter(src.iter().cloned()).len())
- })
- .throughput(|elems| Throughput::Bytes(**elems as u32)),
- );
-}
-
-criterion_group!(benches, from_str_iter);
-criterion_main!(benches);