Repository navigation
Fix route analyzer performance with highly concatenated strings - #54479
Conversation
|
@jjonescz, @CyrusNajmabadi, @cston Roslyn expert opinion on this fix would be great. |
|
I've greatly simplified this PR. The new workaround is to avoid calling Detection behavior doesn't 100% emulate embedded language classification by Roslyn, but I've found some odd quirks when mixing multiple lang comments in a string concat tree from Roslyn anyway. The analyzer behavior here is good enough for normal usage. It's the best balance I've found between good behavior, good performance, and minimal code change. |
|
@JamesNK i just went with dotnet/roslyn#72620 as a simple approach. |
Perfect, I like it. Trying to match Roslyn behavior while getting good perf was wrapping this PR up in knots. Great that Roslyn just simplified, and this PR can copy it. Performance with this change is good - 0.09s after compared to 5s before |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
… string concatenations
…outePatternAnalyzerTests.cs Co-authored-by: Martin Costello <[email protected]>
ccc7afe to
c00323c
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/backport to release/8.0 |
|
Started backporting to release/8.0: https://github.com/dotnet/aspnetcore/actions/runs/8429842063 |

Fixes #54293
Fixes #53899
Route analyzer introduced in .NET 8 is causing very long build times if some projects. Highly concatenated strings caused a lot of time to be spent in
HasLanguageComment.The PR:
0.2 seconds0.05 secondsThis PR will likely be backported to 8.0.