Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JMH benchmark to measure multi-producer batch publication performance. #483

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

nicholassm
Copy link
Contributor

Batch publication has much more complicated logic in the MultiProducerSequencer compared to the SingleProducerSequencer where the cursor is simply updated with the high sequence value.
Therefore, there is also room for optimizations! :-)
Specifically, I am working on an idea to use just a single bit per slot in the ring buffer to represent "publication status" rather than an int and it should have the same performance for single event publication but better performance for the batch publication case.
I've already seen great results with this approach in the Rust port I've written (https://github.com/nicholassm/disruptor-rs) and I would like to explore the same idea in the "original" Disruptor.
But first it would be nice with a JMH benchmark to actually measure things.
That's what this small Pull-Request adds. On my laptop, batch publication has 3 times higher throughput compared to single event publication. Can we do better?

@nicholassm
Copy link
Contributor Author

Any progress on merging this one?

Kind regards
Nicholas

@grumpyjames grumpyjames merged commit bfc35ee into LMAX-Exchange:master Sep 11, 2024
8 checks passed
@grumpyjames
Copy link
Member

This looks very exciting - apologies it took us so long to wake up.

Merged - looking forward to seeing the number go up :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants