Skip to content

Commit 4a5384e

Browse files
authored
true, false: Drop benches less than 1 nano sec (#11210)
1 parent 9654e4a commit 4a5384e

2 files changed

Lines changed: 2 additions & 18 deletions

File tree

src/uu/false/benches/false_bench.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@ use divan::{Bencher, black_box};
77
use uu_false::uumain;
88
use uucore::benchmark::run_util_function;
99

10-
/// Benchmark the common case: false with no arguments
11-
#[divan::bench]
12-
fn false_no_args(bencher: Bencher) {
13-
bencher.bench(|| {
14-
black_box(run_util_function(uumain, &[]));
15-
});
16-
}
17-
18-
/// Benchmark multiple consecutive invocations (throughput test)
10+
/// Benchmark multiple consecutive invocations (avoid less than 1 ns)
1911
#[divan::bench]
2012
fn false_consecutive_calls(bencher: Bencher) {
2113
bencher.bench(|| {

src/uu/true/benches/true_bench.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@ use divan::{Bencher, black_box};
77
use uu_true::uumain;
88
use uucore::benchmark::run_util_function;
99

10-
/// Benchmark the common case: true with no arguments
11-
#[divan::bench]
12-
fn true_no_args(bencher: Bencher) {
13-
bencher.bench(|| {
14-
black_box(run_util_function(uumain, &[]));
15-
});
16-
}
17-
18-
/// Benchmark multiple consecutive invocations (throughput test)
10+
/// Benchmark multiple consecutive invocations (avoid less than 1 ns)
1911
#[divan::bench]
2012
fn true_consecutive_calls(bencher: Bencher) {
2113
bencher.bench(|| {

0 commit comments

Comments
 (0)