Hi,
in my use case, i have lots of channels across several processes, but most of them are low-traffic, i.e. the time between send
s are usually somewhere between tens of milliseconds to several hours (possibly only once or never during the entire runtime of the program).
I have noticed some processes have a high CPU usage even when they don't really have anything to do but wait. I looked at it with firefox profiler and found lots of threads spending a great amount of time in crossbeam code. At first I thought this was some kind of profiling fluke or me using the tools wrong in some way, but it turns out apparently crossbeam makes heavy use of spinlocks, which of course is less than ideal for my use case where there's a large number of channels and most of them have no messages most of the time.
Without swapping out all channel implementations in my codebase against every available channels library and benchmarking that, can anyone recommend a channel implementation that would work better for my use case?
Bonus points if there's some kind of select!
macro that can race such a low-traffic channel for a higher-traffic one for which i may continue to use crossbeam.
3 posts - 2 participants