Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

Remove DiagnosticAdapter and use DiagnosticListener directly#852

Merged
lmolkova merged 4 commits into
developfrom
lmolkova/NoDiagnosticAdapter
Mar 23, 2019
Merged

Remove DiagnosticAdapter and use DiagnosticListener directly#852
lmolkova merged 4 commits into
developfrom
lmolkova/NoDiagnosticAdapter

Conversation

@lmolkova
Copy link
Copy Markdown

@lmolkova lmolkova commented Mar 20, 2019

Try out using DiagnosticListener without DiagnosticAdapter and see it it improves performance


public void OnNext(KeyValuePair<string, object> value)
{
if (value.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Start")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be better as a switch instead of an if/else/../else chain.

@lmolkova lmolkova changed the title [WIP] Remove DiagnosticAdapter and use DiagnosticListener directly Remove DiagnosticAdapter and use DiagnosticListener directly Mar 22, 2019
@lmolkova
Copy link
Copy Markdown
Author

I think @Dmitry-Matveev has proof that it indeed saves some performance and it should be merged.
Current functional tests are sufficient.

I believe the main reason for perf hit from DiagnosticsAdapter was in IRouteData interface - we created this to avoid taking the dependency on the Microsoft.AspNetCore.Routing.Abstractions and DiagnosticAdapter was dynamically typing IRouteData from that package to ours.

Copy link
Copy Markdown
Contributor

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmolkova Please add changelog.md as well.

@cijothomas cijothomas added this to the 2.7.0 milestone Mar 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants