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

Find all Reference performance #4789

Closed
Lennon925 opened this issue Dec 26, 2019 · 7 comments
Closed

Find all Reference performance #4789

Lennon925 opened this issue Dec 26, 2019 · 7 comments
Milestone

Comments

@Lennon925
Copy link

Hi Sean,
Currently cpptools parse related code symbols until we use "Find All Reference". It give reference results very slowly if your project is large. Cpptools can parse all code files and store them in some ways so that it can give results quickly ? Even though it will take long time to parse all files. I think it's worthy.

@sean-mcmanus
Copy link
Contributor

We need to know what the status UI is saying when the majority of the slowness is occurring. Is it saying "files confirmed"? We can only store "tag parse" results in our database (which gets us a small set of files with potential lexical references) and not IntelliSense parsing results (which is required to confirm the lexical references).

@sean-mcmanus sean-mcmanus added Feature: Find All References Find All References, Peek References, Rename Language Service more info needed The issue report is not actionable in its current state performance labels Dec 27, 2019
@Lennon925
Copy link
Author

Lennon925 commented Dec 28, 2019

We need to know what the status UI is saying when the majority of the slowness is occurring. Is it saying "files confirmed"? We can only store "tag parse" results in our database (which gets us a small set of files with potential lexical references) and not IntelliSense parsing results (which is required to confirm the lexical references).

Yes, it's saying "files confirmed" when slowness is occurring. In a large project, usrs often use "find all references". If it's too slowly, it will influence reading code efficiency seriously.

@sean-mcmanus
Copy link
Contributor

There is no way for us to store the files confirmation results. If the number of files that need to be confirmed is large, then using a computer with more cores could help, i.e. a machine with 16 cores would be able to confirm references up to 4 times faster than a 4 core machine. The processing time during confirming is mostly spent on parsing the TU.

These 2 issues could help reduce the number of files that need to be confirmed.
#4708
#4617

#4038: This would only speed up cases where the 2nd Find All References needs to confirm in TUs that got created from the 1st Find All References. However, the manual workaround is to open the files you want "cached".

@sean-mcmanus sean-mcmanus removed the more info needed The issue report is not actionable in its current state label Dec 30, 2019
@yangshangde
Copy link

@sean-mcmanus So no possible way to speed up the performance? Our project has thousands of files, the tool is fantastic only except for the finding reference performance...

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Dec 31, 2019

@yangshangde The number of files in a project shouldn't affect Find All References performance in the "confirmation" stage -- you could have 100 files or a million and the time it takes to confirm references in 10 files should be around the same.

Our telemetry indicates that Find All References performance is not a major problem for most users and uses, although potentially some users might be hitting bugs or special cases (I'm not aware of any known issues though). What sort of timing are you seeing (i.e. number of files to search, time to search, number of files to confirm, time to confirm)?

ipch files are not getting used by the Find All References TUs if they exist already, so it might be possible to use those to speed up confirmation. UPDATE: Looks like our IntelliSense code doesn't have a read-only mode for ipch caches, so it would have to be added (which is unlikely to happen any time soon).

@sean-mcmanus
Copy link
Contributor

If your core count is too high compared to memory used/available, doing Find All References could cause memory thrashing and reduced performance. I've filed an issue tracking improving this at #4811.

@bobbrow bobbrow added this to the Backlog milestone Jan 9, 2020
@bobbrow
Copy link
Member

bobbrow commented Jan 9, 2020

We're using #4051 to track performance issues with find all references. Closing this one as a duplicate. If you have specific information about your workspace that we can use to tune our algorithms, please add it to that issue.

Thank you!

@bobbrow bobbrow closed this as completed Jan 9, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants