-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Remove some allocations from ManifestBuilder.CreateManifestString #44532
Conversation
Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti Issue meta data
|
CC @noahfalk |
For the RuntimeEventSource, this removes around 30K of allocation, though that's only ~3% of what gets allocated.
d04031e
to
9678357
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'm a little worried because I don't trust our tests to catch any subtle bugs here, but the change is small enough it's probably fine.
Is there something I could do to make us more confident? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - as David mentioned we don't have that many tests that catches manifest generation issues (which we really should add) but this change is fairly small and is pretty well understood. Adding @josalem for another pair of eyes to take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I'd be curious to take a look offline at some of the perf data you collected if it's worth sharing.
The thing that needs to happen is to add more tests, which is too much to ask of you for this change. I think it's a small enough change that we can merge. |
Ok, thanks. Just to put my mind at ease (I don't like changing code when we believe tests to not cover it well), I ran: using System;
using System.Diagnostics.Tracing;
Console.WriteLine(EventSource.GenerateManifest(typeof(object).Assembly.GetType("System.Diagnostics.Tracing.NativeRuntimeEventSource"), null)); before and after this change, and there were no diffs in the output. |
@josalem, here's an example, looking at startup allocations for a |
Just happened to see this low-hanging fruit while looking at some traces. For the RuntimeEventSource, this removes around 30K of allocation, though that's only ~3% of what gets allocated.
Contributes to #44598
cc: @brianrob