-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce allocations from creating MissingTokenWithTrivia objects (#75404)
* Reduce allocations from creating MissingTokenWithTrivia objects This method accounts for 0.7% of allocations in the roslyn csharp editing speedometer test profile I'm looking at. In addition to caching tokens < LastTokenWithWellKnownText similar to what is already done, the SyntaxKind.IdentifierToken case is handled as it's very commonly hit too. Local testing of opening LanguageParser and typing in a new method reduced the number of MissingTokenWithTrivia from over 1 million to zero.
- Loading branch information
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters