Skip to content
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

Merged
merged 1 commit into from
Nov 18, 2020

Conversation

stephentoub
Copy link
Member

@stephentoub stephentoub commented Nov 11, 2020

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

@stephentoub stephentoub added this to the 6.0.0 milestone Nov 11, 2020
@stephentoub stephentoub added the tenet-performance Performance related issue label Nov 11, 2020
@ghost
Copy link

ghost commented Nov 11, 2020

Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti
See info in area-owners.md if you want to be subscribed.


Issue meta data

Issue content: 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.

cc: @brianrob

Issue author: stephentoub
Assignees: -
Milestone: [object Object]

@tarekgh
Copy link
Member

tarekgh commented Nov 11, 2020

CC @noahfalk

For the RuntimeEventSource, this removes around 30K of allocation, though that's only ~3% of what gets allocated.
@noahfalk
Copy link
Member

cc @davmason @sywhang @josalem

Copy link
Member

@davmason davmason left a 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.

@stephentoub
Copy link
Member Author

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?

Copy link
Contributor

@sywhang sywhang left a 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.

Copy link
Contributor

@josalem josalem left a 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.

@davmason
Copy link
Member

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?

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.

@stephentoub
Copy link
Member Author

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.

@stephentoub stephentoub merged commit e28dbe9 into dotnet:master Nov 18, 2020
@stephentoub stephentoub deleted the manifestalloc branch November 18, 2020 22:40
@stephentoub
Copy link
Member Author

I'd be curious to take a look offline at some of the perf data you collected if it's worth sharing.

@josalem, here's an example, looking at startup allocations for a dotnet new webapi app:
image

@ghost ghost locked as resolved and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants