mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
true, false: Drop benches less than 1 nano sec (#11210)
This commit is contained in:
@@ -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(|| {
|
||||
|
||||
@@ -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(|| {
|
||||
|
||||
Reference in New Issue
Block a user