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

Improve Razor startup allocations #4326

Open
ryanbrandenburg opened this issue Aug 11, 2021 · 1 comment
Open

Improve Razor startup allocations #4326

ryanbrandenburg opened this issue Aug 11, 2021 · 1 comment
Labels
external Scope involves an area outside of the repo perf 📊
Milestone

Comments

@ryanbrandenburg
Copy link
Contributor

Currently a large Razor project takes about 30 seconds to be fully available. That's partially out of our control, but we also allocate a lot (5GB total was allocated in my test of a large app), and could likely cut that time significantly by improving allocations. Here are some of the identified painpoints:

Parent Size Cause Note
CSharpSyntaxTree.IsGeneratedCode 140.4MB StringBuilder operations inside TryUnescapeSectionName dotnet/roslyn#54511
WorkspaceAnalyzerConfigOptionsProvider.GetOption 213.9 StringBuilder operations inside TryUnescapeSectionName dotnet/roslyn#54511
Tokenizer.EndToken 147.8MB Use string pooling?
Lexer.LexSingleDirective 823.0MB List expansion in Lexer.AddTrivia, CreateWhitespaceTrivia func https://github.com/dotnet/roslyn/blob/main/src/Compilers/CSharp/Portable/Parser/Lexer.cs#L2510
@NTaylorMullen
Copy link
Contributor

@ryanbrandenburg moving this to the external tracking project bit

@allisonchou allisonchou transferred this issue from dotnet/aspnetcore Oct 1, 2021
@allisonchou allisonchou added external Scope involves an area outside of the repo perf 📊 labels Oct 1, 2021
@allisonchou allisonchou added this to the 17.1 Candidates milestone Oct 1, 2021
@davidwengier davidwengier modified the milestones: Next Release Candidates, Backlog Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Scope involves an area outside of the repo perf 📊
Projects
None yet
Development

No branches or pull requests

4 participants