You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the performance test of MPSC, when simulating 2 and 4 producers respectively, Crossbeam's performance is much better than Java-Disruptor, but when simulating 8 and 16 producers, Crossbeam is worse than Java-Disruptor. My testing device has 16 cores and 64GB. May I ask what caused this problem?
Here are the results of two experiments, the first with 2 producers and the second with 8 producers. The abscissa represents the buffer size and the ordinate represents the time consumption.
The text was updated successfully, but these errors were encountered:
My answer may not be correct. AFAIK, if you are using the unbounded channel, its underlying is a linked list; each node can hold 32 elements. Let's say,
[block1(32 elements)] -> [block2(32 elements)]
If in your code, your channel now has 32 elements, so the first block is full, and you send a new element, a new node will be created (allocation required), and if the consumer consumes this element immediately, the second node will be destroyed. If this situation repeatedly happens, as Rust does not have a garbage collector, frequent alloc and dealloc may lead to slow performance.
My answer may not be correct. AFAIK, if you are using the unbounded channel, its underlying is a linked list; each node can hold 32 elements. Let's say,
[block1(32 elements)] -> [block2(32 elements)]
If in your code, your channel now has 32 elements, so the first block is full, and you send a new element, a new node will be created (allocation required), and if the consumer consumes this element immediately, the second node will be destroyed. If this situation repeatedly happens, as Rust does not have a garbage collector, frequent alloc and dealloc may lead to slow performance.
Thanks for your answer, I'm using a bounded channel, but your answer really made me learn.
In the performance test of MPSC, when simulating 2 and 4 producers respectively, Crossbeam's performance is much better than Java-Disruptor, but when simulating 8 and 16 producers, Crossbeam is worse than Java-Disruptor. My testing device has 16 cores and 64GB. May I ask what caused this problem?
Here are the results of two experiments, the first with 2 producers and the second with 8 producers. The abscissa represents the buffer size and the ordinate represents the time consumption.
The text was updated successfully, but these errors were encountered: