-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Short-circuit tagger usage of interval tree when tagging complete snapshot #70285
Short-circuit tagger usage of interval tree when tagging complete snapshot #70285
Conversation
…pshot Noticed when looking at CPU usage on prism for completion scenario. It looks like the primary culprit that I saw when debugging locally was outlining (TTag was IStructureTag2). I was seeing requests spanning the full snapshot with ~2000 entries in spansToInvalidate when editing in the languageparser.cs file in the Roslyn sln. The Except call would end up creating a 2000 entry set, and proceed to remove all 2000 entries from it. Addresses https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1897704
// Performance: No need to fully realize spansToInvalidate or do any of the calculations below if the | ||
// full snapshot is being invalidated. | ||
if (firstSpanToInvalidate.Length == firstSpanToInvalidate.Snapshot.Length) | ||
return Array.Empty<ITagSpan<TTag>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fascinating. do we know why the entire span is being invalidated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can see, very few of the Roslyn taggers override GetSpansToTag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to discuss this on monday.
Noticed when looking at CPU usage on prism for completion scenario. It looks like the primary culprit that I saw when debugging locally was outlining (TTag was IStructureTag2). I was seeing requests spanning the full snapshot with ~2000 entries in spansToInvalidate when editing in the languageparser.cs file in the Roslyn sln. The Except call would end up creating a 2000 entry set, and proceed to remove all 2000 entries from it.
Fixes AB#1897704