-
Notifications
You must be signed in to change notification settings - Fork 199
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
Use PooledArrayBuilder<SyntaxToken> throughout parsers and tokenizer #10095
Conversation
This change avoids allocating List<T>'s throughout the parsers and tokenizer, and usese pooled lists instead.
❓is yardstick still a thing? does it capture these? |
Yardstick is still a thing. What it really does is run PerfView with a set of good defaults for Visual Studio, does a bunch of analysis over the results, and produces a text report. In particular, I've found the |
Oh yea, I just meant I generally enjoy the amount of warnings/errors it gave on finding things that are probably bad. I was hoping if you ran it on this speedometer etl it would just be like "Hey, don't do that please" |
@ToddGrun is my yard stick. 😄 |
src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs
Show resolved
Hide resolved
214359a
to
c36b8d2
Compare
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.
Generally seems fine to me, but it does seem like ref readonly
would be better in a few places than in
here.
@ToddGrun shared a couple PerfView stacks with me where the Razor compiler was allocating
List<SyntaxToken>
instances in the tokenizer. To remove those allocation, this change replacesList<SyntaxToken>s
throughout the parsers and tokenizer, and usesPooledArrayBuilder<SyntaxToken>
instead. In addition, I removed a couple ofConcat
calls and replaced them with pooledStringBuilders
.