lprq-rs

Crates.iolprq-rs
lib.rslprq-rs
version0.1.0
created_at2025-06-19 14:07:26.744297+00
updated_at2025-06-19 14:07:26.744297+00
descriptionA Rust implementation of the LPRQ
homepagehttps://github.com/WilleBerg/lprq-rs
repositoryhttps://github.com/WilleBerg/lprq-rs
max_upload_size
id1718407
size852,603
William Berg (WilleBerg)

documentation

README

lprq-rs

lprq-rs is a Rust implementation of the LPRQ. It is a very fast concurrent lock-free queue, outperforming most, if not all, other popular Rust concurrent queues at higher thread counts.

Usage

use lprq_rs::LPRQueue;

fn main() {
    let q: LPRQueue<i32> = LPRQueue::new();
    q.enqueue(1);
    assert_eq(q.dequeue(), Some(1));
}

Performance

lprq-rs was benchmarked using the rusty-benchmarking-framework.

It performs a lot better than all other concurrent queues benchmarked after 6 threads for τ = 0.5 and 0.7. The poor performance for for τ = 0.3 is probably due to no optimisation for the empty queue, however that is planned to be implemented.

Benchmark results

Here are results from three different benchmarks using varying tau (τ) values to control the enqueue/dequeue ratio.

Benchmark Setup: Threads are synchronized to start simultaneously, with each thread alternating between enqueue and dequeue operations based on a random number r ∈ [0,1) - enqueueing when r > τ, dequeueing otherwise. Additional random operations simulate realistic workloads between each queue operation.

For implementation details, see the rusty-benchmarking-framework.

Commit count: 13

cargo fmt