Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example replaced by walkdir-list, but README not updated #152

Open
afontenot opened this issue Jul 4, 2021 · 1 comment
Open

example replaced by walkdir-list, but README not updated #152

afontenot opened this issue Jul 4, 2021 · 1 comment

Comments

@afontenot
Copy link

afontenot commented Jul 4, 2021

In 526d70b the example was replaced by the walkdir-list crate, but the README still references this old example:

# Compile and test speed of `walkdir` crate:
cargo build --release --example walkdir
time ./target/release/examples/walkdir $DIR
@afontenot
Copy link
Author

afontenot commented Jul 4, 2021

Incidentally, I wonder if you have some idea why walkdir might be so much faster than nftw on my system. I discovered this while writing my own code using them, but I found that it's easily replicable with your example programs:

$ ./target/release/walkdir-list -tcq /usr
739824
duration: 845.646209ms

In nftw.c, I removed the printf call and built it with gcc -O3.

$ time ./nftw /usr
./nftw /usr  0.33s user 1.52s system 99% cpu 1.869 total

Walkdir is faster than find for me as well.

Edit: using strace, it looks like the difference is probably that nftw calls stat on every file in the tree, whereas walkdir does not (presumably only calling stat when needed). If that's what's happening here, may be worth mentioning that in the README?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant