-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Iterative loop for ls recursive directory search #8728
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
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #8728 will degrade performances by 5.24%Comparing Summary
Benchmarks breakdown
Footnotes
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
42a3af8
to
d3ba40d
Compare
GNU testsuite comparison:
|
…utils into recursive_loop
GNU testsuite comparison:
|
according to https://codspeed.io/uutils/coreutils/branches/kimono-koans%3Arecursive_loop |
GNU testsuite comparison:
|
GNU testsuite comparison:
|
i rerun the benchmark: |
I'd say performance isn't the primary driver of this 1st/2nd/3rd step? Of course recursion can be faster than an iterative approach, especially in trivial/small cases (which I'll admit are the mostly the scenario for And, as discussed, this is a step:
In other PRs, I've removed mutable state, removed the DirEntry (a >1K bloat) from the PathData struct, so now we can clone PathData and move PathData onto a new thread (!), such that concurrent search is at least possible. Even a rayon::join() is nearly possible now (to see why not, see the DirEntry in the PathData struct), whereby we simply spawn a rayon thread to get the next read_dir ready, while enter_directory runs. Despite recursion being perhaps the best for the common case, we have to prepare for the worst case. It's why we use a HashMap instead of a BTreeMap, which would undoubtedly be the faster method in the common case. We have to anticipate Firefox cache directories with 700K items, etc. These are all iterative steps (har har) which may provide more flexibility to refactor into something better in the future. For instance, below, you have to imagine the 2nd is more cache friendly than the 1st, simply because the loops are tighter, but we need to get rid of
I'd also be very pleased to add all my PRs into a mega update, a mega update which shows measurable performance gains, if you would accept a mega update? Or any other approach the maintainers would prefer. But somethings just aren't going to last, if this program ever wants to be faster, like mutable state everywhere and certain fat structs, etc. Someone is going to have to refactor them out sometime to get anywhere with |
…info, clone struct to avoid additional syscalls
…info, clone struct to avoid additional syscalls Fix lints
…ed such info, clone struct to avoid additional syscalls" This reverts commit e89886e.
…utils into recursive_loop
…ans/coreutils into recursive_loop" This reverts commit de1fd8d, reversing changes made to d0c7b82.
GNU testsuite comparison:
|
GNU testsuite comparison:
|
Would resolve: #8725