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

perf in LogMessage #4453

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

SimonCropp
Copy link
Contributor

@SimonCropp SimonCropp commented Dec 26, 2024

I assume logging is in the hot path. so a few more lines for better oerf is justified

move over to using EnumerateInvocationList

@Evangelink
Copy link
Member

Evangelink commented Dec 28, 2024

I have synced the Polyfill package.

@Youssef1313
Copy link
Member

Youssef1313 commented Dec 29, 2024

@Evangelink We need to add the updated version to https://github.com/dotnet/source-build-reference-packages/tree/main/src/textOnlyPackages/src/polyfill/

I'll take care of that.

@Youssef1313
Copy link
Member

I opened dotnet/source-build-reference-packages#1105
@SimonCropp It may take a while to get that PR merged due to holidays.

// Making sure all event handlers are called in sync on same thread.
foreach (Delegate invoker in OnLogMessage.GetInvocationList())
foreach (LogMessageHandler invoker in DelegatePolyfill.EnumerateInvocationList(OnLogMessage))
Copy link
Member

Choose a reason for hiding this comment

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

Note: we don't call Logger.LogMessage at all. I don't know how much consumers will be calling this, but it doesn't seem to be a hot path.

@Evangelink I'm not sure if there are "valid" use cases for this Logger class or not. If not, we should consider breaking in v4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants