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
improve find performance #75
improve find performance #75
Conversation
awesome! |
@tw4452852 It is possible to add some performance benchmarks to see the difference it makes in actual numbers? |
Benchmarks depends very much on the latency of the file system used. For a ram disk, iirc the speed went up at least 20% in cpu usage as a result of less iowait. |
use walkOnGoRoutine in any directory instead of root Signed-off-by: Tw <tw19881113@gmail.com>
Signed-off-by: Tw <tw19881113@gmail.com>
e6c2351
to
ae5ef12
Compare
@balta2ar Sorry for late response. I did a test on my local, here is result: I find all the makefile in a kernel source code tree, with the original pt: with the improved pt: |
generally I found that the increased disorder or results were not worth the increased speed. |
Thank you for benchmarking this, @tw4452852. What about adding this as an option? 9.772 -> 2.778 looks significant to me. What do you think? |
IIRC my test above was ran on a 1.5gb tmpfs, on my mechanical drives the difference was not noticeable at all. Depending on disk seek timings this change could potentially be slower as well (I don't have any data on this). Making it optional and turned off by default is probably a good idea. It became really annoying using pt inside an Emacs window because every time I refreshed the results the order became radically different. For small searches an |
I'd go with an option. @tw4452852, could you implement it, please?
This sounds more like an #86 issue, which in fact can be extended, e.g. so that one can specify sort field like this |
Yeah, these issues are related but not the same. I figured to mention the other issue as well. |
Signed-off-by: Tw <tw19881113@gmail.com>
@balta2ar Done. |
Also another finding: in original code, the |
It is faster now, also find all the Makefile in kernel source tree: time pt --multi-finder -g Makefile . >/dev/null |
Thank you very much, @tw4452852! Love your activity here! By the way, do you think it's worth adding unit tests for this option? |
Signed-off-by: Tw <tw19881113@gmail.com>
@balta2ar Of course. I have added a test for it. |
Great job! Guys, @tw4452852 @thomasf @monochromegane before this is set in stone, what if we think of some other name for this option? I'm not saying "--multi-finder" is bad and that we should change it, I'm just offering to think one last time to maybe find something even better and more intuitive. Naming things right matters a lot in my opinion. Please suggest your ideas, if any. Thanks! |
Ideally it should not use two words.. I guess that what it does can be described as maximizing IO throughput by being more concurrent. Something like --concurrent could maybe work, the help string would then need to clarify that it actually means increasing the concurrency rather than turning it on. I'll revisit this at the end of my day to see if I have other ideas then. |
How about |
Thank you for the PR, I check and merge this at this weekend. And I will release new version. 🍻 |
Thanks, @monochromegane! |
Maybe an integer flag so that user can control it.. -maxpar N (?) |
I checked, and thanks everyone !
I think this is a good idea, but now go-flags implementation can't represent the following
if you have a idea, please send a pull request. |
improve find performance
use walkOnGoRoutine in any directory instead of root to improve concurrency.