diff --git a/src/uu/df/Cargo.toml b/src/uu/df/Cargo.toml index 2711201dad8..a2dce98b71c 100644 --- a/src/uu/df/Cargo.toml +++ b/src/uu/df/Cargo.toml @@ -30,9 +30,6 @@ uucore = { workspace = true, features = ["benchmark"] } [target.'cfg(unix)'.dependencies] rustix = { workspace = true, features = ["fs"] } -[target.'cfg(unix)'.dev-dependencies] -rustix = { workspace = true, features = ["stdio"] } - [lints] workspace = true diff --git a/src/uu/df/benches/df_bench.rs b/src/uu/df/benches/df_bench.rs index 50d3dd180b6..1200ef729f2 100644 --- a/src/uu/df/benches/df_bench.rs +++ b/src/uu/df/benches/df_bench.rs @@ -38,39 +38,6 @@ fn df_deep_directory(bencher: Bencher) { env::set_current_dir(original_dir).unwrap(); } -#[cfg(unix)] -#[divan::bench] -fn df_with_path(bencher: Bencher) { - use rustix::stdio::dup2_stdout; - use uucore::benchmark::run_util_function; - - let temp_dir = TempDir::new().unwrap(); - let temp_path_str = temp_dir.path().to_str().unwrap(); - let stdout_bak = rustix::io::dup(rustix::stdio::stdout()).unwrap(); - let devnull = fs::OpenOptions::new() - .write(true) - .open("/dev/null") - .unwrap(); - - bencher.bench_local(|| { - dup2_stdout(&devnull).unwrap(); - black_box(run_util_function(uumain, &[temp_path_str])); - }); - - dup2_stdout(&stdout_bak).unwrap(); -} - -#[cfg(not(unix))] -#[divan::bench] -fn df_with_path(bencher: Bencher) { - let temp_dir = TempDir::new().unwrap(); - let temp_path = temp_dir.path(); - - bencher - .with_inputs(|| get_bench_args(&[&temp_path]).into_iter()) - .bench_values(|args| black_box(uumain(args))); -} - fn main() { divan::main(); } diff --git a/src/uu/du/benches/du_bench.rs b/src/uu/du/benches/du_bench.rs index 39c58a3b261..7812e3ba3fa 100644 --- a/src/uu/du/benches/du_bench.rs +++ b/src/uu/du/benches/du_bench.rs @@ -110,21 +110,6 @@ fn du_summarize_balanced_tree( .bench_values(|args| black_box(uumain(args))); } -/// Benchmark du with --max-depth -#[divan::bench(args = [(6, 4, 10)])] -fn du_max_depth_balanced_tree( - bencher: Bencher, - (depth, dirs_per_level, files_per_dir): (usize, usize, usize), -) { - let temp_dir = TempDir::new().unwrap(); - let temp_path = temp_dir.path(); - fs_tree::create_balanced_tree(temp_path, depth, dirs_per_level, files_per_dir); - - bencher - .with_inputs(|| get_bench_args(&[&"--max-depth=2", &temp_path]).into_iter()) - .bench_values(|args| black_box(uumain(args))); -} - fn main() { divan::main(); }