Add eager-push/eager-pop benchmarks #151
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In my quest for more realistic/relevant benchmarks, I have created two more benchmarks. Both of them use two threads (as before) and two queues each. The second thread simply "echoes" every item back to the first thread.
One of the benchmarks tries to keep both queues as full as possible by always pushing as many items as possible, while only popping one:
The other benchmark does the opposite, in that it tries to keep the queues as empty as possible by always popping as many items as possible, but only pushing one:
Except for very short queues, the actual capacity doesn't have much of an influence (the capacity is currently set at 4096).
What stands out to me in the above results is that the
crossbeamqueue is much worse than the rest with a big margin (as I would have expected in the very beginning, but the other benchmarks - included below - don't show a big margin, it is even sometimes better thanringbuf). There is no real difference betweenrtrbandomango, contrary to the old benchmarks. In both old and new,ringbufis the slowest SPSC queue. There seems to be no real difference between eager pushing and eager popping, but I don't really know if I should have expected any ...Any other insights?
Are there any suggestions for improvements?
If somebody wants to try the new benchmarks on their own machines, go ahead, and if possible, please share the results here!
For reference, the two old benchmarks are still there: