Code Monkey home page Code Monkey logo

Comments (6)

fabiospampinato avatar fabiospampinato commented on September 15, 2024 5

As of v2.0.0 performance should be much better, I've been editing a 7k+ lines file without too many problems. Editing smaller files should feel pretty quick.

Some previous O(n) scenarios are now O(1):

  • Editing an undecorated line
  • Editing a line where the decorations are fixed
  • Editing a line where the entire line is decorated

I've also optimized the code quite a bit, but unfortunately I couldn't properly cache decorations of unedited lines, turns out VSC's APIs are pretty lacking in this regard. I'm going to keep this open as performance could be improved even further, but there's not much that I can do without proper APIs, upstream issues:

from vscode-todo-plus.

beeplin avatar beeplin commented on September 15, 2024 5

I guess the lag is caused by redrawing the whole document each time the document is changed -- that is, each time a key is pressed. Maybe we could improved it by introducing some kind of debouncing behavior. When keep typing continuously, it can wait until the typing stoped for, say, 1 second.

from vscode-todo-plus.

beeplin avatar beeplin commented on September 15, 2024 2

I came from #210 and is suffering from the same lag in a 100 lines todo file. Have to reload vscode window again and again to avoid the lag. :(

from vscode-todo-plus.

fabiospampinato avatar fabiospampinato commented on September 15, 2024 1

It looks like there's a "Semantic tokens API", could be interesting: microsoft/vscode#86415

from vscode-todo-plus.

fabiospampinato avatar fabiospampinato commented on September 15, 2024

Another currently O(n) scenario that could be optimized to be O(1) is this:

  • Editing a file where decorations aren't fixed, but they are at the very end of the line. Basically editing a todo with one or more tags at the end.

from vscode-todo-plus.

marco-m avatar marco-m commented on September 15, 2024

microsoft/vscode#50346 has been closed as dup of microsoft/vscode#585

from vscode-todo-plus.

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.