James Newton-King

Results 320 comments of James Newton-King

To come up with the right improvement for this situation I'm going to reach out to OpenTelemetry team for their advice. One approach might be to skip recording system endpoints....

Not in the last 6 days. .NET 9 won't come out until November so there is lots of time to improve this scenario. If you're looking for an immediate solution...

Is that a problem? The code here: https://github.com/dotnet/aspnetcore/blob/276e3fe165e299c090c5ff66394420d4ede15a8e/src/Framework/AspNetCoreAnalyzers/src/Analyzers/RouteEmbeddedLanguage/Infrastructure/RouteStringSyntaxDetector.cs#L142-L206 Is copied from Roslyn: https://github.com/dotnet/roslyn/blob/891584232dc8112f33376e9ee9486051a1014b24/src/Features/Core/Portable/EmbeddedLanguages/EmbeddedLanguageDetector.cs#L67-L125

I've recreated the slow performance in a test: https://github.com/dotnet/aspnetcore/pull/54479 I looked into this for a couple of hours - and I stepped through code in the aspnetcore repo and Roslyn...

![image](https://github.com/dotnet/aspnetcore/assets/303201/2818ab4d-7a4e-459e-9998-73600b52429c)

I'm going to see if I can optimize walking up the nested string concat tree by remembering the last analyzed string. For example, if "c" in the example below doesn't...

@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 `GetLeadingTrivia()` on every level of a nested binary expression. Instead, check the first parent of the string node...

> @JamesNK i just went with [dotnet/roslyn#72620](https://github.com/dotnet/roslyn/pull/72620) as a simple approach. Perfect, I like it. Trying to match Roslyn behavior while getting good perf was wrapping this PR up in...