Skip to content
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

Edits inside a function can cause a big increase in IntelliSense update time #13064

Open
sean-mcmanus opened this issue Dec 17, 2024 · 2 comments
Labels
bug Language Service performance Visual Studio Inherited from Visual Studio Works in VS So we'd need to fix it for VS Code to reach parity.
Milestone

Comments

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Dec 17, 2024

I have a repro with 3.2k functions that each calls another function (generated with the help of Copilot), and after just 4 edits it starts taking around 8 times as long to update the TU. I don't repro the same behavior in VS. The processing time goes down to the original update time after a save.

It seems to repro for all TUs in general after enough edits are made, but the particular repro case seems like a "worst case" for some reason.

@sean-mcmanus sean-mcmanus added bug Language Service performance Works in VS So we'd need to fix it for VS Code to reach parity. labels Dec 17, 2024
@sean-mcmanus sean-mcmanus changed the title Edits can cause a big increase in IntelliSense update time Edits can cause a big increase in IntelliSense update time (until a save occurs) Dec 17, 2024
@heartacker
Copy link

yes. slow here

@bobbrow bobbrow moved this to Todo in cpptools Dec 17, 2024
@sean-mcmanus sean-mcmanus self-assigned this Dec 19, 2024
@sean-mcmanus sean-mcmanus moved this from Todo to In progress in cpptools Dec 19, 2024
@sean-mcmanus sean-mcmanus changed the title Edits can cause a big increase in IntelliSense update time (until a save occurs) Edits can cause a big increase in IntelliSense update time (until a save occurs, edit with ; or } or C/C++ document switch) Dec 20, 2024
@sean-mcmanus
Copy link
Contributor Author

sean-mcmanus commented Dec 20, 2024

It repros in VS too if no save, edit with ; or }, replace/rename edit, or document/window switch occurs. The only difference compared to VS is that we don't trigger an IntelliSense update with a preparse if the document switches from a non-C++ file and back (which we used to be prior to 1.5 in June 2021) or from a different app window and back (which we never implemented, i.e. via handling onWindowStateChanged).

i.e. it seems like this performance issue would only occur if the user were making a lot of modification edits to a large TU with lots of definitions, such as adding comments. UPDATE: Actually, it's also fixed when the cursor moves to a new line, i.e. modifications to different lines won't repro the issue.

UPDATE: Modifications or cursor changes inside a function don't free the memory, but a save will still (even though it doesn't in VS).

I filed a VS bug for the "in function" memory accumulation (and update slowdown) on edits: https://developercommunity.visualstudio.com/t/C-IntelliSense-memory-usage-and-update/10817292 .

This issue is tracking multiple issues so it might need to be split into separate issues if only a subset of issues is fixed.

@sean-mcmanus sean-mcmanus changed the title Edits can cause a big increase in IntelliSense update time (until a save occurs, edit with ; or } or C/C++ document switch) Edits can cause a big increase in IntelliSense update time (until a save occurs, edit with ; or }, replace/rename edit, or C/C++ document switch) Dec 20, 2024
@sean-mcmanus sean-mcmanus removed their assignment Dec 20, 2024
@sean-mcmanus sean-mcmanus removed the status in cpptools Dec 20, 2024
@sean-mcmanus sean-mcmanus changed the title Edits can cause a big increase in IntelliSense update time (until a save occurs, edit with ; or }, replace/rename edit, or C/C++ document switch) Edits can cause a big increase in IntelliSense update time (until the cursor moves to a new line, a save occurs, edit with ; or }, replace/rename edit, or C/C++ document switch) Dec 20, 2024
@sean-mcmanus sean-mcmanus changed the title Edits can cause a big increase in IntelliSense update time (until the cursor moves to a new line, a save occurs, edit with ; or }, replace/rename edit, or C/C++ document switch) Edits inside a function can cause a big increase in IntelliSense update time Dec 20, 2024
@sean-mcmanus sean-mcmanus added this to the Tracking milestone Dec 20, 2024
@sean-mcmanus sean-mcmanus added the Visual Studio Inherited from Visual Studio label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Language Service performance Visual Studio Inherited from Visual Studio Works in VS So we'd need to fix it for VS Code to reach parity.
Projects
Status: No status
Development

No branches or pull requests

2 participants