Skip to content

Commit

Permalink
Merge pull request #491 from mgeisler/simplify-benchmark-names
Browse files Browse the repository at this point in the history
Simplify benchmark names
  • Loading branch information
mgeisler authored Nov 9, 2022
2 parents 583b9b1 + 406913f commit 5473ec8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions benchmarks/linear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn lorem_ipsum(length: usize) -> String {
}

pub fn benchmark(c: &mut Criterion) {
let mut group = c.benchmark_group("String lengths");
let mut group = c.benchmark_group("fill");
let lengths = [
0, 5, 10, 20, 30, 40, 50, 60, 80, 100, 200, 300, 400, 600, 800, 1200, 1600, 2400, 3200,
4800, 6400,
Expand All @@ -33,7 +33,7 @@ pub fn benchmark(c: &mut Criterion) {
.wrap_algorithm(textwrap::WrapAlgorithm::new_optimal_fit())
.word_separator(textwrap::WordSeparator::UnicodeBreakProperties);
group.bench_with_input(
BenchmarkId::new("fill_optimal_fit_unicode", &length_id),
BenchmarkId::new("optimal_fit_unicode", &length_id),
&text,
|b, text| {
b.iter(|| textwrap::fill(text, &options));
Expand All @@ -44,7 +44,7 @@ pub fn benchmark(c: &mut Criterion) {
.wrap_algorithm(textwrap::WrapAlgorithm::new_optimal_fit())
.word_separator(textwrap::WordSeparator::AsciiSpace);
group.bench_with_input(
BenchmarkId::new("fill_optimal_fit_ascii", &length_id),
BenchmarkId::new("optimal_fit_ascii", &length_id),
&text,
|b, text| {
b.iter(|| textwrap::fill(text, &options));
Expand All @@ -55,14 +55,14 @@ pub fn benchmark(c: &mut Criterion) {
.wrap_algorithm(textwrap::WrapAlgorithm::FirstFit)
.word_separator(textwrap::WordSeparator::AsciiSpace);
group.bench_with_input(
BenchmarkId::new("fill_first_fit", &length_id),
BenchmarkId::new("first_fit", &length_id),
&text,
|b, text| {
b.iter(|| textwrap::fill(text, &options));
},
);

group.bench_function(BenchmarkId::new("fill_inplace", &length_id), |b| {
group.bench_function(BenchmarkId::new("inplace", &length_id), |b| {
b.iter_batched(
|| text.clone(),
|mut text| textwrap::fill_inplace(&mut text, LINE_LENGTH),
Expand All @@ -78,7 +78,7 @@ pub fn benchmark(c: &mut Criterion) {
.word_separator(textwrap::WordSeparator::AsciiSpace)
.word_splitter(textwrap::WordSplitter::Hyphenation(dictionary));
group.bench_with_input(
BenchmarkId::new("fill_optimal_fit_ascii_hyphenation", &length_id),
BenchmarkId::new("optimal_fit_ascii_hyphenation", &length_id),
&text,
|b, text| {
b.iter(|| textwrap::fill(text, &options));
Expand Down

0 comments on commit 5473ec8

Please sign in to comment.