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

Faster EventSource attribute lookup #45621

Merged
merged 4 commits into from
Jan 22, 2021

Conversation

benaadams
Copy link
Member

@benaadams benaadams commented Dec 4, 2020

From #45121 (comment)

Contributes to #44598

@ghost
Copy link

ghost commented Dec 5, 2020

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

Issue Details

From #45121 (comment)

Author: benaadams
Assignees: -
Labels:

area-System.Diagnostics.Tracing, area-Tracing-coreclr

Milestone: -

@stephentoub
Copy link
Member

Do you have data on the impact of this?

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Ben!

@benaadams
Copy link
Member Author

Do you have data on the impact of this?

Calling into the runtime's MemberInfo.IsDefined by default

image

Drops the allocations when the method is called

From:
image

To:
image

As it no longer allocates since #44694

EventManifestOptions flags = EventManifestOptions.None)
{
// AllowEventSourceOverride is an option that allows either Microsoft.Diagnostics.Tracing or
// System.Diagnostics.Tracing EventSource to be considered valid. This should not matter anywhere but in Microsoft.Diagnostics.Tracing (nuget package).
Copy link
Member

Choose a reason for hiding this comment

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

Then should it be ifdef'd out of corelib?

Copy link
Member Author

Choose a reason for hiding this comment

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

I copied it from GetCustomAttributeHelper just below; not sure about what it means in practice?

@benaadams
Copy link
Member Author

Rebased to restart CI

benaadams and others added 4 commits January 20, 2021 14:52
…acing/EventSource.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
@benaadams
Copy link
Member Author

Aside: though this has 2 approvals and all tests passed, I can't merge as don't have commit rights

@stephentoub stephentoub merged commit 061e0aa into dotnet:master Jan 22, 2021
@benaadams benaadams deleted the eventsource-attributes branch January 22, 2021 19:03
@ghost ghost locked as resolved and limited conversation to collaborators Feb 21, 2021
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.

8 participants