npkill icon indicating copy to clipboard operation
npkill copied to clipboard

Possible performance improvement

Open StarpTech opened this issue 6 years ago • 1 comments

Hi, funny project and I think I can help you with your Improve performance even more! roadmap point.

Use fd as an alternative to find with cross platform compatibility.

StarpTech avatar Aug 18 '19 10:08 StarpTech

Will look into it, thanks for the suggestion :D

NyaGarcia avatar Aug 18 '19 17:08 NyaGarcia

It's been a while since this was opened but it's finally time for this one to touch on this topic.

The other day I was solving another issue related to windows "find" (#117) until I thought: -Wait, how efficient is find respect to our GO implementation?- So after several benchmarks this is the result (file cache cleaned every run):

Command Mean [s] Min [s] Max [s] Relative
find /home/juanimi -name 'node_modules' -prune 2>/dev/null 45.716 ± 0.471 44.948 46.466 6.75 ± 0.10
go run ./npkill/src/libs/file-service.go /home/juanimi node_modules 6.775 ± 0.065 6.628 6.855 1.00
fd -H node_modules 8.127 ± 0.085 8.017 8.328 1.20 ± 0.02
fd -H node_modules -E node_modules #equal to -prune in find 6.885 ± 0.018 6.858 6.910 1.02 ± 0.01

So with these results I think it is clear that we should abandon the use of find and not only use the GO script in the windows implementation.

So in these days I will try to take care of this. But first I would have to resolve #135.

I will keep updating with news. Any ideas or comments are welcome!

zaldih avatar Nov 01 '22 16:11 zaldih

I just released 0.11.1 🎉 , which includes some changes that significantly improve performance by using multi-threading.

The search has been completed. If there are no problems, this issue should be solved.

zaldih avatar Mar 24 '23 07:03 zaldih