vscode-code-outline icon indicating copy to clipboard operation
vscode-code-outline copied to clipboard

Code Outline with unformatted JSON, high CPU

Open JayNaire opened this issue 7 years ago • 1 comments

Just an observation, (file under FYI) :

Opening a JSON "log" file (about 200kB, rough format below) that doesn't contain any formatting / newlines incurs 100% CPU time for about 13 minutes. The code outline then appears correctly and all is well.

Formatting the document, saving and reopening results in no hogging and a delay of just 2 seconds or less before the outline appears.

Whether the hog is from native vscode json or Code Outline I know not. code --status says CPU% is 100% for extensionHost when hogging occurs CPU% is 0% for electron_node jsonServerMain.js

FWIW: JSON format:

{ "roomTemperatures": { "Room1": [ { "x": "2018-02-16T12:45:47.623Z", "y": 20.3 }, ...another 500 data points ], ...another 13 rooms }

JayNaire avatar Mar 02 '18 11:03 JayNaire

Code Outline does not do any document parsing on its own and relies on the SymbolProvider API to be implemented by specific language extensions. I believe the JSON one is built into VS Code itself.

patrys avatar Mar 02 '18 14:03 patrys