-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
🐞 Threading Issues #86
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
Comments
Hi there @nanashili! I'd like to take a swirl on this one! Thanks! |
Hi @heyvito, i think it might be the amount of lines as the issue that caused that was a very small file but had a lot of lines. Steps to reproduce would to just be open a file with that spands a few hundered lines and see if the issue occurs. |
@heyvito looks like that issue has been fixed.... But I did find another threading issue you might want to attempt When trying to close multiple tabs fast the editor breaks due it not being able to remove the tabs fast enough. You can reproduce this by opening multiple tabs and closing them fast. |
Got it! I opened a relatively small file (14.5+k lines), and didn't noticed any hang, but it indeed consumed 100-110% of CPU for a brief moment. Taking a spindump, the responsible was AttributedString + JSCore, which are used by Highlightr. A better approach would be to use something more native to handle syntax highlighting altogether, and perhaps only try to stylise what is on the viewport (and what is about to become visible), together with Tree Sitter (leveraging viktorstrate/swift-tree-sitter, for instance) or any other engine. I have a small background on that, so lmk in case you folks need help. 🌻 Regarding the tabs, I'll take a look! Thank you for reporting! |
@MarcoCarnevali @pkasila might want to looks at this. |
I believe that Highlightr is causing a lot of issues right now like freezing while loading large file, lagging while scrolling, color-flashing while inputing, etc. And I agree that a real native editor should not come up with a solution involving JSCore. If you would like to rebuild current syntax highlighting feature by using a native engine, or (probably) build one from ground-up, I would like to join and help. |
This is the CPU usage while opening a file that has 30k lines. It freezes for around 2 seconds (totally frozen) and then has some scroll-lags in the next ten seconds. After that, it runs smooth, but it is not an acceptable experience while opening the file. (Device is running on Apple M1 Pro with 16GB memory) |
@heyvito @lilingxi01 Thanks for your input! We know that Highlightr is not very efficient and we are evaluating other options. I'm not quite sure what the current state is but I think we will be going the Tree Sitter route. Please get in contact with @MarcoCarnevali and @pkasila on that matter. We appreciate your help and are looking forward to what you come up with. Also have a look at issue #36 |
[chore]: Refactor to use binary framework for `tree-sitter` language grammars
When opening a large file the editor takes a massive hit in performance and ends up using a lot of resources on thread one. Also when you try to scroll it needs to load the file every time due to its size.
Tabs
When trying to close multiple tabs fast the editor breaks due it not being able to remove the tabs fast enough.
You can reproduce this by opening multiple tabs and closing them fast.
The text was updated successfully, but these errors were encountered: