-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 extension is slow #12017
Comments
@adam2farkas When you set C_Cpp.loggingLevel to "Debug" and repro the slowness, what type of logging do you see being output and/or when you hover over the {} C++ status icon in the bottom right what does say is processing? |
I'm seeing similar behavior across multiple linux distributions. No suggestions, very slow definition finding. Reverting back to a earlier version fixed this. |
@mojomojo52 Can you tell me which extension did you downgrade and to what version? |
I downgraded C/C++ for Visual Studio Code from v1.19.4 to v1.18.5. |
To investigate this, we could really use the debug output Sean asked for above. There are many things this could be. For instance, 1.19.4 made a database change, which will cause reindexing. Once re-indexing is complete, performance should return to normal. 1.19.4 also introduced progressive IntelliSense updating, which updates IntelliSense in small portions at a time, which should actually result in a significant apparent performance improvement, as squiggles and colorization will appear much more quickly for the visible portion of the code and allow other requests to occur mid-update rather than waiting for the full update to complete before processing the next operation. 1.19.4 will also keep all visible sources up to date with IntelliSense instead of only a single active document. It's also possible a specific operation, perhaps even a new feature, is taking longer than expected and delaying processing of other operations in queue. Without a debug log, we can only guess. This doesn't appear to be a general problem impacting everyone, so there would seem to be something about the repro conditions we would need more information about to investigate further. |
This might be related to this #12051 although mine never completes so is worse than slow! Downgrading fixes mine too. |
This is happening to me also, downgrading to v1.18.5 seems to solve the issue OS and Version: Windows 11 Here's the Debug output, some part were cut because output is too long
` Then I open another .cc file and
Then starts scanning again when I navigate my source code, tooltips begin to show Loading... and Instellisense appears updating
As you can see for example, last intellisense update took 22s on an SSD and with WSL 1, which has faster access to the host filesystem than WSL2. After a bit even Go to Definition (F12) stop working Hope that helps |
Hi @AndreGuimRua . Can you confirm what you're experiencing that is slower? Note that the In 1.19.5, we also addressed a bug in which IntelliSense was not properly being delayed/deferred while typing. Some users have reported this ~1 second delay after typing as a perf issue, but it's actually intentional. This means that as you are typing actively, no update will be taking place against your incomplete code. That is not because IntelliSense is running more slowly. Another possible perf issue with 1.19.5 may be a VS Code bug in which we sometime receive several hundred requests for folding ranges. We're in the process of investigating this. If you are seeing this issue, you might see |
Hi @Colengms , When I talk about IntelliSense being slow, is >1 second (it wouldn't be an issue for me otherwise). |
After a while, issues arise again. I have a some .h files in the same folder, like config.h and utilities.h
After a while, when I click over utilities.h and press F12 to go to the definition. It takes 20s to open the utilities.h file (it's in the same folder)
When the first 'LSP: Sending response (id: 618)' appears, it remains there for a few seconds, then the other info is printed. In the dev console only this appears:
Hope any of this info helps |
Hey @sean-mcmanus, this issue might need further attention. @adam2farkas, you can help us out by closing this issue if the problem no longer exists, or adding more information. |
This has also fixed it for me immediately. |
Hi @Anguinru
By default, IntelliSense won't start updating within 1 second. There is an intentional delay of 1 second after editing before an IntelliSense pass occurs. We get perhaps as many requests for IntelliSense not to refresh while typing, as we do for IntelliSense to start refreshing more quickly. That delay was actually "fixed" in 1.19.4: From the release log:
You can reduce or eliminate that delay by changing the value of the
There was recently a bug in VS Code that resulted in this error and did indeed have a significant impact on perf until it was addressed in VS Code v1.88. The issue was microsoft/vscode#206841 Since your last repro was specifically with header files, if you are still seeing an issue, I suspect it may have something to do with newer versions of the Extension perhaps choosing different source files for header translations units. (When a header is opened, a source file that includes that header is actually chosen to host IntelliSense for that header). If you're still able to repro, could you provide the output of running the @thennothinghappened We're not currently tracking significant perf regressions between these versions. (At least not any we're gotten sufficient information on to reproduce). I'd highly recommend for anyone experiencing a perf issue to open a new GitHub issue (rather than assume another unidentified performance issue is a match) with the information requested in our new issue template. We've made several performance improvements recently, and I would be eager to collect actionable information on any reported performance regressions. |
When I get a moment I'll have a look at what versions are affected specifically and/or if I'm on an outdated vscode. The issue on my end presents as two things:
Rolling back to 1.18.5 fixed both, but the latter was still noticably slow if now usable. |
Alright, quick update. I've grabbed some videos of both versions. v1.18.5c_cpp.1.18.5.movv1.19.9c_cpp.Latest.release.movNotably this is right after installing both, so both are on an equal playing field with caching anything. What I did notice was that v1.19.9 seemed to improve a bit over time - visiting the same file multiple times from a reference would be faster - it was still far slower than v1.18.5, and sometimes failed to find it. I have confirmed I'm on the latest vscode (v1.88.1). |
Another data point here. When I load a large project with the 1.19.9 version, the editor responds slowly and the CPU fan starts running continuously. Looking at a system monitor, I see the cpptools process taking up 100% of one CPU. So perhaps one thread is hanging up. When I downgrade to 1.18.5 I don't have any problems, as others have said. Unfortunately, this also happens with the pre-release version, 1.20.3, so I guess it's not yet fixed in the next update. |
@seansovine You should check the C/C++ language status or logging to see what is going on (or attaching a debugger and getting a call stack with 1.20.3). We have not reproed this internally yet and do no yet know what is causing it, so more information would help. |
@sean-mcmanus For one project I had a warning about the intellisense mode being changed. I realized I did not have a I opened another large C++ project, that had no So maybe the slowness / high CPU problem is just caused by having a bad configuration for the extension, and some change between 1.18.5 and the current release has caused this to have a more noticeable impact? In the past I seem to remember having this issue in projects where I had configured the C/C++ extension, not just ones where I had not done the config. Maybe in those cases I had the extension misconfigured somehow. I will report back if the problem shows up again. |
@seansovine We fixed some bugs in 1.20.x that could cause excessive CPU usage. |
@adam2farkas Oh, I just realized your original issue might not be fixed -- does your extension slowness issue still repro with 1.20.3 or newer? |
Sorry, but I work on a managed server, currently I cannot update to a newer version thatn 1.19.9. I will check it later.
From: Sean McManus ***@***.***>
Sent: 2024. május 2., csütörtök 21:45
To: microsoft/vscode-cpptools ***@***.***>
Cc: Farkas, Adam (ADV D EU HU OPS 1 DRT 12) ***@***.***>; Mention ***@***.***>
Subject: Re: [microsoft/vscode-cpptools] C/C++ intellisense extension is slow (Issue #12017)
@adam2farkas<https://github.com/adam2farkas> Oh, I just realized your original issue might not be fixed -- does your extension slowness issue still repro with 1.20.3 or newer?
-
Reply to this email directly, view it on GitHub<#12017 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BGD2Y4OWLNNAG2UZI2IIQ4LZAKJSRAVCNFSM6AAAAABD2LRWFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJRGQZDEMBVGM>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
It takes ages to parse the project when the IDE is started, however, it might be enough at first to parse the opened files and the ones that are related technically (seen by the compiler, eg. includes and dependencies defined by cmake). This slows down development as developers have to wait till the project is parsed. Before this point, the program has almost identical capabilities like Notepad.
Steps to reproduce:
Open a medium sized project.
Expected behavior:
Fast scan and proper suggestions.
Configuration and Logs
I was not able to find a c_cpp_properties.json file except for the schema file. I have no idea what logs can be helpful to this issue.
Other Extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: