-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C/C++ intellisense extremely slow with large codebases (due to populating file name cache) #12169
Comments
IMHO, it doesn't seem like performance is this extension's priority, because there are a ton of issues titled similarly to this. I also wish it could be faster, but I ended up resorting to the |
@kitswas I just tried cloning your project and configured with CMake on Windows. Is there a particular file that you are having problems with? I wasn't able to repro a performance problem with the few files I tried. ns-3-dev.mp4This is on a local machine though. You seem to indicate that you're connecting to a remote machine? It's not WSL, is it? Can you share more details about your remote setup? Our extension doesn't manage communication back and forth between machines, but it's possible that something is configured sub-optimally that is resulting in delays. It looked like there were only about 3300 source/header files in this repo and our extension can normally handle a project of that size ok. @trustytrojan We feel your pain and have been experimenting with alternate approaches to deal with the performance issues you are referring to. These efforts have not yielded the wholesale improvements we're looking for yet, but we have been scaling up the investment here and hope to announce more improvements in the future. Our most recent improvements were released in version 1.19 (progressive IntelliSense updates, and a rewrite of the symbol search feature). |
@kitswas Also, if you can set C_Cpp.loggingLeve to "Debug", the logging might indicate what is taking so long to process. Also, with 1.20.0 (pre-release), you could attach a debugger and provide the call stacks (for the thread that appears to be using the CPU). |
ns3 can only run/compile in a Linux environment. To use ns-3 on Windows, you need the Windows Subsystem for Linux (WSL) or the Msys2/MinGW64 toolchain. Did you wait for all the symbols to get highlighted and the popup-on-hover to start working?
I am connecting to an Ubuntu 22.04 machine via ssh over LAN.
That's the base ns3 repo with no third-party modules. My current repo has 4177 C++ source and header files. |
@sean-mcmanus It contains the lines:
That's a total of 25 seconds for Intellisense to become fully functional. |
@kitswas Yes, it's stuck populating the file name cache. This is a performance issue we've are aware of and I believe another member on our team is actively working on fixing that (unless I'm mistaken). One prior bug is #11954 , although that doesn't mention IntelliSense being blocked, so we can use this issue to track the IntelliSense case. Well, that's for the 15 sec, but the 10 sec updating time might be improvied via #3628 or #5362 or other performance work that is in progress. |
As @sean-mcmanus mentions, the filename cache is an area we're working to improve. Soon, this will only delay IntelliSense the first time you open a workspace, not every time you open the same workspace. For me with all files local to the machine, this doesn't take long.
I didn't have to wait long. I'm not sure why your machine takes 10 seconds and mine takes 1 second.
We have heard of issues with remote work taking longer, but it's hard to know. Are all of your files/compilers/headers local to the remote machine, or are there any network drives involved? All of my remotes are dead right now, but I was able to spin up a Codespace for this repo and saw some numbers closer to yours. filename cache took 3~5 seconds to populate. IntelliSense took 3~8 seconds depending on the source file.
I didn't try to build on Windows. I just configured with CMake to get IntelliSense configurations and tested the IntelliSense. The Codespace is linux.
I was looking for instructions, but didn't see anything about submodules or anything. If you have more info on how to set this up, I can add the extra files and see if it makes a difference. Also, the file in your log wasn't in the default repo (contrib is empty for me), so I couldn't test with that file. |
Thank you for your patience.
All my files are on a drive local to the remote machine (Dell PowerEdge t440).
Try this repo. https://gitlab.com/kitswas/coexistence-wigig-5gnr/-/tree/master/scratch?ref_type=heads#3rd-party-modules |
same here |
@kitswas @trustytrojan @XuPengfei-1020 We've made improvements with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.22.0 . Let us know if it's still an issue for you with that version. |
As of today, I've updated C/C++ Extension to v1.22.9 for VSCode 1.93.1 and still got very high disk I/O when opening C++ project on remote. My source code is not that large, but linked to PyTorch and CUDA. Anyway, after switching to Clangd, it's so much faster. It also tells me about unused header files. |
29th November 2024 VSCode info ::
Extension info ::
Configs ::
The same issue on Windows 11. Intellisense is horribly slow and never finishes (for a source file https://github.com/anoban/cpp23/blob/main/rvopt.cpp with just 42 lines of C++ code it takes about 12 minutes immediately after cold start). On the other hand |
Environment
uname -a
Linux hp-PowerEdge-T440 6.5.0-26-generic #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Mar 12 10:22:43 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Bug Summary and Steps to Reproduce
Bug Summary:
Large codebases like ns-3 take 2~5 min after opening and ~10s after that for whichever file you open to prepare syntax highlighting and IntelliSense.
Steps to reproduce:
git checkout tags/ns-3.40
Expected behaviour:
Configuration and Logs
Other Extensions
No response
Additional context
htop
shows only a single CPU core at 100% when a new file is opened. All the others are idle. (<10%)The text was updated successfully, but these errors were encountered: