-
Notifications
You must be signed in to change notification settings - Fork 504

Description
Hey @papertigers, I just saw your message on IRC, which I am repeating here:
Have you done any testing with sending values at a decently high throughput?
I noticed that sending values relatively quickly through a crossbeam channel results in a lot yields and increased CPU usage compared to std::sync::mpsc
is a small example that shows what I am talking about
https://gist.github.com/papertigers/0bd33bc0f1241463dcee35763337c579
Thanks for the report! I think it'd be easier to chat either over on GitHub or on our discord channel since we have moved off IRC.
My guess what is going on here is that in std::sync::mpsc
, Sender
in std::sync::mpsc
is slower than its corresponding Receiver
so the messages build up and nobody ever has to block.
On the other hand, it may be that in crossbeam-channel
, Sender
is slower than Receiver
so sometimes the Receiver
has to block, which is where those yields come from.
Could you perhaps verify if my hypothesis is true?