Open indirectlylit opened 2 years ago
Hi @indirectlylit . Thanks for reporting this. We can use this issue to track investigating further. However, given the variety of different features that exhibit performance issues (i.e. Formatting, which does not leverage our IntelliSense engine), I suspect the performance issue may be related to SSH or Docker. If so, you may be able to confirm this if you detect similar issues with other extensions, such as language services for other languages.
Thanks for response. I understand that this is a tricky one because I can't give clear steps to reproduce.
On my side, I can say that:
you may be able to confirm this if you detect similar issues with other extensions, such as language services for other languages
If you have any suggestions on a test I can run to narrow down where the problem is I'd be happy to help. Otherwise I'd recommend we close this issue so it doesn't become a catch-all for a range of performance issues.
(I'd also be interested in better understanding the implications of setting "C_Cpp.intelliSenseCacheSize": 0
)
The formatting is likely just getting stuck being an IntelliSense update operation.
The intelliSenseCache setting will cause .ipch files to be created/read which store info about the headers -- on some setups this may hurt performance, particular if the headers are being modified.
Hi, thank you @sean-mcmanus
The formatting is likely just getting stuck being an IntelliSense update operation
Do you mean that it might be blocked by or stuck behind an IntelliSense update?
The intelliSenseCache setting will cause .ipch files to be created/read which store info about the headers -- on some setups this may hurt performance, particular if the headers are being modified.
Yes, I think this is indeed the culprit.
default behavior | setting "C_Cpp.intelliSenseCacheSize": 0 |
---|---|
> 300MB main.ipch file under /root/.cache/vscode-cpptools/ipch |
empty ipch dir |
editing a .hpp file causes "Updating IntelliSense" to run for > 30s |
editing a .hpp file causes "Updating IntelliSense" to run for just a few seconds |
On the other hand, editing .cpp
files is fast in both cases. The "intermittency" was just whether I was editing headers or not. I'll update the title.
I mean the thread that handles the formatting message is stuck in a queue waiting for the IntelliSense update to finish.
A related issue is https://github.com/microsoft/vscode-cpptools/issues/5362 -- we should probably disable the ipch cache for the TU automatically if the header is editted instead of repeatedly rebuiding it.
Thanks, that makes sense.
On embedded systems like the Raspberry Pi or Jetson Nano with slow SD cards used for storage, reading or writing large amounts of data can be a major bottleneck. In my situation, VS Code was essentially unusable until disabling the cache.
Describe the bug
I have a cmake-based build configuration and intellisense is correctly finding all dependencies and providing full and correct reporting of issues related to type hints.
Functionality such as auto-completion, problem-reporting, and auto-formatting are incredibly slow when editing header files. For example, occasionally after saving a file I'll see this for a solid 10s or so even on a simple file:
Based on this comment I tried setting
"C_Cpp.intelliSenseCacheSize": 0
and it has helped the situation.Steps to reproduce
Set up a C++ project on an embedded system like a Raspberry Pi or Jetson Nano and try editing header files.
Expected behavior
Relatively consistent and hopefully snappy intellisense and auto-formatting performance
Code sample and logs
Configurations in
c_cpp_properties.json
Logs from running
C/C++: Log Diagnostics
from the VS Code command paletteLogs from the language server logging - let me know if this would be helpful.
Additional context
Let me know if there are further steps I can easily take to identify offending processes. I briefly looked at the Troubleshooting page, but the
perf
profiling tool does not seem to be available on the embedded ARM platform I'm currently developing against (NVIDIA tegra) and compiling/installing it didn't go smoothly.