@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:
Example CPU profile of this branch:
As a result, editing feels much more responsive, and the CPU spikes are also gone!
@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
:Example CPU profile of this branch:
As a result, editing feels much more responsive, and the CPU spikes are also gone!