From 4a5384e1848f754a59089d9c98c996141da48b59 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Fri, 6 Mar 2026 17:40:32 +0900 Subject: [PATCH] true, false: Drop benches less than 1 nano sec (#11210) --- src/uu/false/benches/false_bench.rs | 10 +--------- src/uu/true/benches/true_bench.rs | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/uu/false/benches/false_bench.rs b/src/uu/false/benches/false_bench.rs index eb13c9441..7157068b7 100644 --- a/src/uu/false/benches/false_bench.rs +++ b/src/uu/false/benches/false_bench.rs @@ -7,15 +7,7 @@ use divan::{Bencher, black_box}; use uu_false::uumain; use uucore::benchmark::run_util_function; -/// Benchmark the common case: false with no arguments -#[divan::bench] -fn false_no_args(bencher: Bencher) { - bencher.bench(|| { - black_box(run_util_function(uumain, &[])); - }); -} - -/// Benchmark multiple consecutive invocations (throughput test) +/// Benchmark multiple consecutive invocations (avoid less than 1 ns) #[divan::bench] fn false_consecutive_calls(bencher: Bencher) { bencher.bench(|| { diff --git a/src/uu/true/benches/true_bench.rs b/src/uu/true/benches/true_bench.rs index 1a9cf7aec..5c95e3504 100644 --- a/src/uu/true/benches/true_bench.rs +++ b/src/uu/true/benches/true_bench.rs @@ -7,15 +7,7 @@ use divan::{Bencher, black_box}; use uu_true::uumain; use uucore::benchmark::run_util_function; -/// Benchmark the common case: true with no arguments -#[divan::bench] -fn true_no_args(bencher: Bencher) { - bencher.bench(|| { - black_box(run_util_function(uumain, &[])); - }); -} - -/// Benchmark multiple consecutive invocations (throughput test) +/// Benchmark multiple consecutive invocations (avoid less than 1 ns) #[divan::bench] fn true_consecutive_calls(bencher: Bencher) { bencher.bench(|| {