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

Remove DiagnosticAdapter and use DiagnosticListener directly #852

Merged
merged 4 commits into from
Mar 23, 2019

Conversation

lmolkova
Copy link
Member

@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
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
Member 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
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