-
Notifications
You must be signed in to change notification settings - Fork 471
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
Optimize the oneshot case #199
Comments
Do you have any notes on why this may be? I'd be interested in helping, but I'd need some mentorship here. |
I've noticed several problems affecting performance:
There might be more. :) |
Just responding as I discover things.. I tried naively removing the cache padding to see what effect it might have: about a 2-5% speedup (385ns seemed to be the lower bound for no padding, with the padded versions being 390-400ns). Also, it doesn't look like EDIT: I lied, I see the mutex in |
Another thing that might be worth trying: Instead of |
FYI: I tried an implementation based on the single-element queue used in concurrent-queue (async-channel): 77e70ae The performance of oneshot and SPSC has been improved, but there were regressions in the performance of MPMC, MPSC, and SPMC. Before: crossbeam-channe/benches/oneshot.rs
crossbeam-channe/benches/crossbeam.rs
After: crossbeam-channe/benches/oneshot.rs
crossbeam-channe/benches/crossbeam.rs
|
Here's a simple benchmark:
Results:
While I doubt we'll ever beat
mpsc
in this benchmark, at least let's try getting as close as possible.The text was updated successfully, but these errors were encountered: