Code Monkey home page Code Monkey logo

Comments (8)

heyvito avatar heyvito commented on May 9, 2024 2

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! β™₯️

from codeedit.

heyvito avatar heyvito commented on May 9, 2024

Hi there @nanashili! I'd like to take a swirl on this one!
Would you be so kind as to explain what comprises a large file? Would it be large as in the quantity of columns, lines, or just overall size? How can I attempt to reproduce this issue?

Thanks!

from codeedit.

nanashili avatar nanashili commented on May 9, 2024

Hi there @nanashili! I'd like to take a swirl on this one!
Would you be so kind as to explain what comprises a large file? Would it be large as in the quantity of columns, lines, or just overall size? How can I attempt to reproduce this issue?

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.

from codeedit.

nanashili avatar nanashili commented on May 9, 2024

@heyvito looks like that issue has been fixed.... But I did find another threading issue you might want to attempt
Screenshot 2022-04-14 at 22 10 03

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.

from codeedit.

nanashili avatar nanashili commented on May 9, 2024

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.

from codeedit.

lilingxi01 avatar lilingxi01 commented on May 9, 2024

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.

from codeedit.

lilingxi01 avatar lilingxi01 commented on May 9, 2024

Screen Shot 2022-04-14 at 9 17 57 PM

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)

from codeedit.

lukepistrol avatar lukepistrol commented on May 9, 2024

@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

from codeedit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.