Skip to content

Commit

Permalink
In progress ordered walk
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegrosjean committed Jan 29, 2019
1 parent b63f810 commit ba02dda
Show file tree
Hide file tree
Showing 6 changed files with 335 additions and 390 deletions.
14 changes: 5 additions & 9 deletions benches/walk_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use std::fs;
use std::io::Read;
use std::path::PathBuf;
use std::process::Command;
use walk::ordered_walk;
use walk::walk;
use walkdir::WalkDir;

Expand Down Expand Up @@ -58,9 +57,9 @@ fn walk_benches(c: &mut Criterion) {
.build_parallel()
.run(move || Box::new(move |_| ignore::WalkState::Continue));
})
});
});*/

c.bench_function("rayon_walk", |b| b.iter(|| for _ in walk(linux_dir()) {}));
/*c.bench_function("rayon_walk", |b| b.iter(|| for _ in walk(linux_dir()) {}));
c.bench_function("rayon_walk_first_two_entries", |b| {
b.iter(|| {
Expand All @@ -70,14 +69,11 @@ fn walk_benches(c: &mut Criterion) {
})
});*/

c.bench_function("rayon_ordered_walk", |b| {
c.bench_function("walk", |b| {
b.iter(|| {
let mut count = 0;
for each in ordered_walk(linux_dir()).into_iter() {
count += 1;
//println!("{}", each.path().unwrap().display());
for each_dir_contents in walk(linux_dir()).into_iter() {
for _each_entry in each_dir_contents.contents.iter() {}
}
//println!("{}", count);
})
});
}
Expand Down
6 changes: 2 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
mod ordered_walk;
mod results_queue;
mod walk;
mod work_queue;
mod results_queue;

pub use ordered_walk::walk as ordered_walk;
pub use walk::*;
pub use crate::walk::*;
240 changes: 0 additions & 240 deletions src/ordered_walk.rs

This file was deleted.

Loading

0 comments on commit ba02dda

Please sign in to comment.