diff --git a/benchmarks/linear.rs b/benchmarks/linear.rs index a115632f..40451d85 100644 --- a/benchmarks/linear.rs +++ b/benchmarks/linear.rs @@ -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, @@ -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)); @@ -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)); @@ -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), @@ -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));