-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
<execution>: cache thread::hardware_concurrency #1134
Comments
I don't know whether it should be fixed in |
I think we would need a perf benchmark showing this as a substantial problem before we would want to change this; if I understand correctly Back when I did perf optimizations for the parallel algorithms the cost of |
Profiling has shown that
Under a profiler, and see OS calls as hotspots. |
resolves microsoft#1134 (conservatively) revert to what there were before atomic wait
Should we have a separate issue tracking updating the value so it doesn't get lost in the shuffle once this issue is closed? |
I think the decision can be made in the current PR to do or not to do this; my default take is not to do this |
Reasons not to do timed refresh:
|
What I would do if we want to deal with dynamic CPU count change:
|
I think anyone who cares about hot plugging CPUs cares enough to call the platform topology enumeration APIs and similar since they probably want to support CPUs outside of the default group. As a result I don't think we should worry about that. |
And if group apis are called before |
Decided against it. Thread pool is not actually controlled anyway. |
Fixes #1134. Co-authored-by: Casey Carter <cartec69@gmail.com> Co-authored-by: Billy O'Neal <bion@microsoft.com>
Currently does not cache
hardware_concurrency
value, like it used to in certain configurations.GetNativeSystemInfo
may be a system call, so it may defeat the speedup obtained by parallel algorithms.Consider caching it again.
Note that since number of CPUs may change at runtime, it may be a good idea to refresh the value after some
GetTickCount64
interval.The text was updated successfully, but these errors were encountered: