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

Builds are spending lots of time (~4.5%) of CPU just sleeping #2391

Closed
davkean opened this issue Aug 3, 2017 · 4 comments
Closed

Builds are spending lots of time (~4.5%) of CPU just sleeping #2391

davkean opened this issue Aug 3, 2017 · 4 comments
Labels
performance Performance-Scenario-Solution-Open This issue affects solution open performance. Priority:2 Work that is important, but not critical for the release triaged
Milestone

Comments

@davkean
Copy link
Member

davkean commented Aug 3, 2017

Trying to speed up design-time builds, and I can see that 4.5% of the CPU is just sleeping (is this spin waiting?):

image

Could be related to: #2384.

@davkean
Copy link
Member Author

davkean commented Aug 3, 2017

I can't tell if this is "real" CPU usage or if the thread was really sleeping when PerfView captured. I thought that PerfView sampled whatever the CPU was executing at the time, which would lean to the former.

@davkean
Copy link
Member Author

davkean commented Aug 15, 2017

In this customer's process, 11% of the build is just calling Sleep: dotnet/project-system#2712:

image

@onyxmaster
Copy link

Found this issue occasionally after a PerfView session of my own.
IIRC, this callstack means that thread pool is being hammered with lots of thread creation requests (QueueUserWorkItem, tasks, etc.) that arrive in a short time interval, so yes, #2384 is probably the real deal.

@panopticoncentral panopticoncentral added the Performance-Scenario-Solution-Open This issue affects solution open performance. label Mar 25, 2020
@panopticoncentral panopticoncentral removed this from the MSBuild 15.6 milestone May 21, 2020
@panopticoncentral panopticoncentral added the Priority:2 Work that is important, but not critical for the release label Mar 23, 2021
@ladipro
Copy link
Member

ladipro commented Aug 13, 2021

These sleeps were eliminated in #6678.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance-Scenario-Solution-Open This issue affects solution open performance. Priority:2 Work that is important, but not critical for the release triaged
Projects
None yet
Development

No branches or pull requests

7 participants