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 call to memset in EventPipeBuffer constructor #41194

Merged
merged 1 commit into from
Aug 22, 2020

Conversation

sywhang
Copy link
Contributor

@sywhang sywhang commented Aug 22, 2020

In heavy-write scenarios, it is possible for EventPipeBufferManager::AllocateBufferForThread to block the flushing thread (the thread that is flushing out events out of EventPipeBufferManager to the underlying IPC channel) because they both need to grab the spinlock in EventPipeBufferManager.

From a benchmark I wrote, the memset here was found as taking 10% of the thread time for the flushing thread, and I was able to verify that removing this improves overall throughput of Event writes by ~15% in the benchmark program I have with 24 threads writing events as fast as they can.

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

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.

I'm glad we put that comment in now 😄

@sywhang sywhang merged commit 6fd1edd into dotnet:master Aug 22, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 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.

3 participants