-
-
Notifications
You must be signed in to change notification settings - Fork 815
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
--color=always ~10x slower #720
Comments
500392 calls to
This happens because |
The extra |
Thank you for reporting this. I was aware of this performance problem but never got around to fixing it. Note that the "10x slower" is only true if there are LOTS of search results. Related:
True.
Thank you for the information. Colorizing everything up to the basename also sounds like a reasonable alternative. We won't be able to do this anymore:
Could you go into more detail here? You mean we could buffer results if not writing to a TTY? (if we write to a TTY, we want results to be visible immediately). |
Yeah, I expect stdout to be line buffered when going to a TTY and fully buffered otherwise. That's how it is in C anyway. I thought Rust would do the same thing but it's just always line buffered. |
It can be expensive to color each path component separately, requiring a stat() call on each component. For deep hierarchies this can result in quadratic overhead. Instead, just color the path up to the basename as a directory. Fixes sharkdp#720.
It can be expensive to color each path component separately, requiring a stat() call on each component. For deep hierarchies this can result in quadratic overhead. Instead, just color the path up to the basename as a directory. Fixes sharkdp#720.
It can be expensive to color each path component separately, requiring a stat() call on each component. For deep hierarchies this can result in quadratic overhead. Instead, just color the path up to the basename as a directory. Fixes sharkdp#720.
It can be expensive to color each path component separately, requiring a stat() call on each component. For deep hierarchies this can result in quadratic overhead. Instead, just color the path up to the basename as a directory. Fixes sharkdp#720.
It can be expensive to color each path component separately, requiring a stat() call on each component. For deep hierarchies this can result in quadratic overhead. Instead, just color the path up to the basename as a directory. Fixes #720.
Describe the bug you encountered:
I understand that outputting the escape sequences for colors is more text, but I didn't expect it to be 10x slower. Is this expected behavior?
Describe what you expected to happen:
Expected
color=always
to not be 10x slower, although maybe I'm simply misguided.What version of
fd
are you using?fd 8.2.1
(fd-8.2.1-1
on the AUR)Which operating system / distribution are you on?
and
lsb_release
but I don't think it's very helpful :)Ryzen 3900x (24 threads) but it seemed during the bench mark only ~80% cpu was being used.
The text was updated successfully, but these errors were encountered: