-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 perfomance for EventSourceLoggerProvider with EventPipe active #36515
Comments
As part of the migration of components from dotnet/extensions to dotnet/runtime (aspnet/Announcements#411) we will be bulk closing some of the older issues. If you are still interested in having this issue addressed, just comment and the issue will be automatically reactivated (even if you aren't the author). When you do that, I'll page the team to come take a look. If you've moved on or workaround the issue and no longer need this change, just ignore this and the issue will be closed in 7 days. If you know that the issue affects a package that has moved to a different repo, please consider re-opening the issue in that repo. If you're unsure, that's OK, someone from the team can help! |
@ericstj How do use labels/milestones on your team? I want to make sure we bring this up during triage as a 5.0 candidate |
@davidfowl is the goal here to make this completely allocation free at steady state? Did you have specific ideas for low-hanging fruit that we should look at first? |
@ericstj as close as we can get to that. I can't remember where those allocations were coming from. We should get a new profile to see if any of the low hanging fruit sticks out. |
Here's a short summary of an experimentation: using for (int i = 0; i < 10000; i++)
{
_logger.LogCritical("logging critical info");
} The below screenshot shows the allocations meanwhile dotnet trace is running for above application process: From going over the callstacks:
runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs Line 1303 in 171ef84
ultimately gets called. runtime/src/libraries/Microsoft.Extensions.Logging.EventSource/src/LoggingEventSource.cs Lines 159 to 165 in 171ef84
runtime/src/libraries/Microsoft.Extensions.Logging.EventSource/src/LoggingEventSource.cs Lines 171 to 177 in 171ef84
Causing the extra memory allocations seen in the screenshot. Workaround could be to add overloads instead of having the one with params get called cc: @noahfalk I have a Diagnostics Hub Report file (*.diagsession) but github doesnt allow attaching to a comment here. |
We've already spent some cycles improving the noop case here now we need to look more closely at the overhead when using
dotnet trace
:When running an ASP.NET Core application with just the event source logger and this command line to collect logs:
Here's what the allocations look like:
Some of these are inside of EventSource itself and some are inside of the Logger provider implementation.
@shirhatti
The text was updated successfully, but these errors were encountered: