-
-
Notifications
You must be signed in to change notification settings - Fork 78
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 performance on Linux #79
Comments
What operating system (+ version) and what Node.js version? |
$ node --version Ubuntu 18.4 $ trash --version |
Ok, so there are multiple reasons why it's slower:
I'm gonna keep this issue open as "help wanted" to improve performance on Linux. |
May be we could send the process to the background. |
You can easily do that yourself: |
@IssueHunt has funded $80.00 to this issue.
|
From my tests:
So, all in all, should be easier to achieve 2 times faster time. Also, none of optimizations are related to linux directly, they affect all platforms. Another thing to consider is that most of the time is spent in long chains of requires, because there is a lot of really small modules involved instead of bigger ones. |
I don't want to do this, but I'm already planning to optimize
👍 However, this issue was meant to investigate whether there's a way to optimize the actual Linux deletion code. |
@sindresorhus I don't remember the numbers(plus there is some trickery in profiling short-lived processes), but most of the time is spent initializing node and requiring for simple case ( As for more complex scenarios with multiple files and directories, I don't expect there is much to do, except some place at the beginning where I've seen sync code instead of async, but with much work to do further down the line that shouldn't have much impact. |
Did you try profiling on a directory with many subdirectories and thousands of files? That's a better real-world benchmark and what we should optimize for. |
My debug using UPDATE: Full log |
I actually have some results, and am preparing to make PR. @sindresorhus Long story short, the fix includes using procfs. After writing 10th implementation of that stuff and working on optimizing it yet again for the 10th time, I looked around for libraries to access |
Great! More than happy to use it here. |
@sindresorhus has rewarded $72.00 to @stroncium. See it on IssueHunt
|
IssueHunt Summary
stroncium has been rewarded.
Backers (Total: $80.00)
Submitted pull Requests
Tips
IssueHunt has been backed by the following sponsors. Become a sponsor
The text was updated successfully, but these errors were encountered: