-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
High CPU and RAM usage on large files (due to show-whitespace
)
#2732
Comments
show-whitespace
)
Confirmed, this is due to Also perhaps it would be good to find any bottlenecks in the code so it can be made faster in the first place. |
What if instead of using |
I don't understand. How would you rewrite that loop with "promise handlers"? |
What I probably meant is promise chaining. I don't know the terminology too well. But |
Await isn’t slower than promise chains. The lint rule is because await stops the loop and some users don’t realize that. I found the problem of this issue: the feature is currently wrapping each individual character into its own DocumentFragment and then appending the whole thing back. The line in the middle is 200k characters long so you can see how that might take forever to finish. I’m rewriting the feature to be a lot more efficient and I’ll probably also add a line length limit for these cases |
Right, I just figured stopping the loop is what was slowing the whole thing down. Sorry for sticking my nose in this, though; I'm trying to get more involved in OSS but haven't found something that works for me. |
Fixed without adding limits, but it needs a little more work: #2737
You got it the other way: Loops will freeze the browser until they finish. In this case, the loop was doing thousands of operations that probably took minutes in Firefox, without letting the browser breathe.
|
Opening the link below with Refined GitHub uses a lot of CPU and eats all the RAM very quickly.
Be ready to have your computer freeze before clicking the link
https://github.com/teropa/to-sting/blob/master/index.jsRefined GitHub 20.1.22
Firefox 72.0.1 (I couldn't reproduce the issue on Chrome)
Ubuntu 18.04.3 LTS
The text was updated successfully, but these errors were encountered: