-
-
Notifications
You must be signed in to change notification settings - Fork 845
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
[BUG] performance regression in trivial searches between 8.4 and 8.5 persisting in 8.7 #1362
Comments
Is there any slowdown for non-empty directories? Time to search an empty directory is not really something we optimize for, as long as it's still reasonably fast. I did do a quick |
Right, what I am reporting here is not about empty directories per se, it is about initialization overhead. I ran a simple test of searching for With N=10,000 what I suppose are some under-the-hood asymptotic improvements start to become noticeable. For N=100,000 the gap closes to 20 ms (100 ms vs. 120 ms) and for N=1,000,000 the asymptotic effect dominates and we see what we would always like to:
Looking at the linked PR suggests to me that the effect out to be linear in
and the respective wall-clock times are 5.5 ms vs. 193.4 ms which is IMO worth optimizing for if not too hard to fix. I'm not a rust guy, but I am rather curious why it takes so long to initialize memory; even with nproc=128 we're only talking about 2 megabytes, right? Should be ~20x faster.. Maybe a rabbit hole! |
oh whoops I just realized that capacity is 2M messages and presumably we are allocation rather more than 1 byte per message, duh... |
Note that there is also linear overhead just to start N threads, which is significant at -j128. See also #1203. Also I suspect the overhead is actually more from syscall/VM locking overhead for mmap() than initialization, now that I think about it. |
Ah good catch, I suspect that this issue is probably a duplicate of #1203 since it looks like that guy is based on timings from 8.4. I certainly won't disagree that starting N threads has linear overhead however this really ought to be negligible for N=128. Please note that in my last comparison of 8.3 (5.5 ms) vs. 8.7 (193.4 ms) I used |
Checks
Describe the bug you encountered:
It takes nearly 10x longer to search an empty directory with fd 8.7 or 8.5 versus 8.4
FWIW this is not an issue with startup time per se; running
fd --version
does not show any performance drop.Using
-F ""
instead of.
for the pattern show the same performance regression, if that's helpful to know.I am happy to run any additional experiments that might be useful, but I'm afraid that my rust-fu is too weak to be of any use for deeper analysis or proposing a fix.
Describe what you expected to happen:
No response
What version of
fd
are you using?fd 8.4.0 fd 8.5.0 fd 8.7.0
Which operating system / distribution are you on?
The text was updated successfully, but these errors were encountered: