fabiospampinato / vscode-todo-plus

Manage todo lists with ease. Powerful, easy to use and customizable.
MIT License
902 stars 228 forks source link

Fixed slow update of statistics decorations (fixes #210) #367

Closed squidfunk closed 1 year ago

squidfunk commented 1 year ago

@marvinhagemeister and me invested some time tracking down the occasional sluggishness of the extension as I originally reported in #210. We managed to isolate the problem: the repetitive call to vscode.window.createTextEditorDecorationType creates a new decoration type for each decoration. This is not necessary, since we can just reuse the same decoration type for all decorations/ranges. This is also what's recommended by the VS Code team, as can be seen in the decorations example.

Example CPU profile of master:

Bildschirmfoto 2023-01-31 um 23 20 10

Example CPU profile of this branch:

Bildschirmfoto 2023-01-31 um 23 20 19

As a result, editing feels much more responsive, and the CPU spikes are also gone!

fabiospampinato commented 1 year ago

Awesomeeeee! I've released v4.19.1 with this fix in it.

Thank you both! 😘