Closed bpmct closed 1 year ago
We started looking into this, but haven't made any progress yet.
The LSP server comes with a profiler.
I just landed https://github.com/toitlang/toit/commit/d718121795c19fe5c3c382e3cf83bae31cd57483 to make it more convenient to use. Even if we can't easily reproduce this should help us figure out what's going on.
Running the profiler with vscode:
toitLanguageServer.command
/home/flo/.cache/jaguar/sdk
, and store the profiles in /home/flo/tmp/lsp-profile
.
[
"/home/flo/.cache/jaguar/sdk/bin/toit.lsp",
"--toitc", "/home/flo/.cache/jaguar/sdk/bin/toit.compile",
"--cpuprofile", "/home/flo/tmp/lsp-profile"
]
mkdir -p /home/flo/tmp/lsp-profile
).ctrl-shift-p
, followed by Developer: Reload Window
).Every LSP server should now start to provide a profile. However, the profiles (usually) stay empty files until the process is terminated. The best way to do this is to close all Toit tabs in vscode.
It looks like the high CPU usage was caused by another extension opening files in the background.
In this case, disabling CodeTogether solved the issue. At the moment we recommend to disable the CodeTogether extension while editing Toit code.
(I wasn't able to reproduce so I didn't file an issue against them).
I'm seeing extremely high CPU usage on my MacOS (amd64) machine. On Linux, the extension works fine. Here are the logs from the output panel:
Full logs: https://gist.github.com/bpmct/ba17b88a5c43e9d6c35b48082ae7829b