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

Performance vs other crates? #8

Open
TheButlah opened this issue Apr 11, 2021 · 3 comments
Open

Performance vs other crates? #8

TheButlah opened this issue Apr 11, 2021 · 3 comments

Comments

@TheButlah
Copy link

A basic performance comparison would be great to compare against other rust ringbuffers, as well as crossbeam channel.

@mgeier
Copy link

mgeier commented Apr 11, 2021

See also mgeier/rtrb#39.

@agerasev
Copy link
Owner

agerasev commented Apr 14, 2021

Hi, thank you for being interested in this crate!

Honestly speaking, the performance wasn't the main goal of the crate and I haven't focused on it heavily. I created that crate just to have at least some implementation of ring buffer being light-weight and with direct access to underlying memory. And I'm glad to see that now there is a variety of a ring buffer implementations to choose from.

About your question - @mgeier made a nice comparison and according to it rtrb seems to be a better option.

It's interesting to find out where 3x performance difference come from. Maybe in near future I will find some time to investigate this and to apply some optimizations.

@mgeier
Copy link

mgeier commented Apr 22, 2021

It's interesting to find out where 3x performance difference come from.

I guess a part of it comes from false sharing of the head and tail indices as suggested in #7.

#7 (comment) mentions another potential optimization by trying to read the atomic indices less often.

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

No branches or pull requests

3 participants