Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
The README section contains a link to my fork of crossbeam repository, where I've added a [channel-like implementation](https://github.com/wyfo/crossbeam/blob/bench\_sbq/crossbeam-channel/benchmarks/channel.rs) of swap-buffer-queue (with `Sender`/`Receiver`) and the [benchmark code](https://github.com/wyfo/crossbeam/blob/bench_sbq/crossbeam-channel/benchmarks/swap-buffer-queue.rs) which is similar to the other ones thanks to the channel implementation.
I've originally created this algorithm to optimize IO-buffering of a next-gen ScyllaDB driver, allowing an important performance improvement.
Actually, I've done more advanced tests with MIRI (see https://github.com/rust-lang/miri/issues/2920 for example) which allowed me to fix some issues. I've also made the code compatible with loom, but I didn't found the time yet to write and execute loom tests. That's on the TODO-list, and I need to track it with an issue too.
EDIT: A quick benchmark with this spinloop removed show no performance difference, so it may be a good thing to remove it for real, I've opened an issue https://github.com/wyfo/swap-buffer-queue/issues/2
How does it compare to kanal?
There are some cool crates for this: https://gitlab.com/tdiekmann/safety-guard