gnuradio / newsched

The GNU Radio 4.0 Runtime Proof Of Concept
GNU General Public License v3.0
22 stars 16 forks source link

Debug Queue Performance #232

Open mormj opened 2 years ago

mormj commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

https://github.com/facebook/folly/blob/main/folly/MPMCQueue.h