-
Notifications
You must be signed in to change notification settings - Fork 65
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
Extreme memory usage and slow loading of moderately sized text file #5
Comments
It is likely this is caused by syntax highlighting the entire file at load. I'll be working on lazy loading of files that should help. |
I've pushed improvements to opening large files. |
Another improvement drops the memory usage when loading that file to about 80MB. |
Oh, cool, I did not expect an update. It does load faster now and uses less memory. However, one thing I'm not sure about: Does this just cheat by loading only the beginning of the file? How is the performance and memory usage when you jump to the end of the file? Unfortunately, I can't test this because the scrollbar appears to be broken and I haven't found a working shortcut for jumping to the end of the file. But I do notice that the memory usage creeps up to several GB when I hold down the PageDown key, which leads me to suspect that it's just lazy-loading. Unfortunately, that doesn't really fix the issue. |
There are some more optimizations I would need to come up with to not have to syntax highlight all previous lines before being able to highlight the current scoll location in the file. |
I've pushed some changes, based on pop-os/cosmic-text#206, that reduce the memory usage when scrolling to the end of that file to about 418MB, while still keeping syntax highlighting enabled. |
Additionally, it loads instantly and scrolls to the bottom of the file in 5 seconds. |
Cosmic-edit version: I was going to submit a new issue because the exact same thing happens to me, but then found this closed thread. Opening a 1gb file uses up all 20 available Gb of ram and crashes the PC. Testing with the sqlite3.c file I get the same 3Gb of RAM usage! Did the patches revert at some point? |
Out of curiosity I decided to try my usual editor benchmark with cosmic-text-editor: Opening sqlite3.c (a ~9 MB file which you can download here).
Results:
For comparison:
I understand that this project is still in its infancy, but you might want to address performance before you develop this any further.
The text was updated successfully, but these errors were encountered: