Low latency queues in Rust ecosystem

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • rtrb

    A realtime-safe single-producer single-consumer (SPSC) ring buffer

  • Thanks! Your link lead me to https://github.com/mgeier/rtrb/issues/39 where they compare to different queues. Exactly what I was looking for. Thank you again!

  • spsc_queue

    A fast, concurrent, bounded, single producer, single consumer queue

  • I've been researching how low latency I can get with Rust and if there's anything already built. If I limit the question only to SPSC queues, it looks like crossbeam-channel is the most performant one and needs around 20ns per item. In comparison to e.g. https://github.com/Deaod/spsc_queue with almost 1ns/item (the linked queue is not implemented in Rust and only used as an example of what's physically possible). I don't see why we couldn't have something like that in the Rust ecosystem and am wondering if there are any other places to look for perf structures like that, other than Github or crates.io (or they live under a different tag). Also if I would go for a c++ queue, can somebody share the perf impact of calling it from Rust? Haven't done that yet.

  • 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.

    WorkOS logo
  • crates.io

    The Rust package registry

  • I've been researching how low latency I can get with Rust and if there's anything already built. If I limit the question only to SPSC queues, it looks like crossbeam-channel is the most performant one and needs around 20ns per item. In comparison to e.g. https://github.com/Deaod/spsc_queue with almost 1ns/item (the linked queue is not implemented in Rust and only used as an example of what's physically possible). I don't see why we couldn't have something like that in the Rust ecosystem and am wondering if there are any other places to look for perf structures like that, other than Github or crates.io (or they live under a different tag). Also if I would go for a c++ queue, can somebody share the perf impact of calling it from Rust? Haven't done that yet.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts