Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

Debug Queue Performance #232

Open
mormj opened this issue Apr 27, 2022 · 2 comments
Open

Debug Queue Performance #232

mormj opened this issue Apr 27, 2022 · 2 comments

Comments

@mormj
Copy link
Contributor

mormj commented Apr 27, 2022

The moodycamel queue when nthreads >> ncores is really inefficient. Either go back to the std::dequeue implementation, or figure out how to tune performance

// The number of times to spin before sleeping when waiting on a semaphore.
// Recommended values are on the order of 1000-10000 unless the number of
// consumer threads exceeds the number of idle cores (in which case try 0-100).
// Only affects instances of the BlockingConcurrentQueue.
static const int MAX_SEMA_SPINS = 0; //10000;
@mormj
Copy link
Contributor Author

mormj commented Apr 27, 2022

C++ 20 has std::atomic_flag with waiting methods - if we can move to that there should be a performance gain. See:
https://modernescpp.com/index.php/performancecomparison-of-condition-variables-and-atomics-in-c-20

@mormj
Copy link
Contributor Author

mormj commented Jun 16, 2022

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

No branches or pull requests

1 participant