Skip to content

Commit

Permalink
Add fts to bench
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegrosjean committed Feb 6, 2019
1 parent d3899aa commit 32a527d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ criterion = "0.2.7"
walkdir = "2.2.7"
ignore = "0.4.6"
num_cpus = "1.8"
fts = "0.2.0"

[[bench]]
name = "walk_benchmark"
Expand Down
11 changes: 11 additions & 0 deletions benches/walk_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![allow(unused_imports)]

use criterion::{criterion_group, criterion_main, Criterion};
use fts;
use ignore::WalkBuilder;
use jwalk::WalkDir;
use num_cpus;
Expand Down Expand Up @@ -33,6 +34,16 @@ fn walk_benches(c: &mut Criterion) {
checkout_linux_if_needed();

c.bench_function("walkdir::WalkDir", move |b| {
c.bench_function("fts", move |b| {
b.iter(|| {
for p in fts::walkdir::WalkDir::new(
fts::walkdir::WalkDirConf::new(linux_dir())
.no_metadata()
.no_chdir(),
) {}
})
});

b.iter(|| for _ in walkdir::WalkDir::new(linux_dir()) {})
});

Expand Down

0 comments on commit 32a527d

Please sign in to comment.