true, false: Drop benches less than 1 nano sec (#11210)

This commit is contained in:
oech3
2026-03-06 09:40:32 +01:00
committed by GitHub
parent 9654e4abaf
commit 4a5384e184
2 changed files with 2 additions and 18 deletions
+1 -9
View File
@@ -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(|| {
+1 -9
View File
@@ -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(|| {