Scalability Benchmark

N producer threads push a 4-byte integer into one same queue, N consumer threads pop the integers from the queue. Each producer posts 1,000,000 messages. Total time taken to send and receive all these messages is measured. With SMT threads, the benchmark is run for from 1 producer and 1 consumer up to (total-number-of-cpus / 2) producers/consumers to measure the scalability of different queues. Without using SMT threads (cross-core communication only) -- up to (total-number-of-cpus / 4) producers/consumers. A benchmark run reports the best msg/sec throughput out of 10 tries for each queue. The charts report mean, stdev, min and max of msg/sec throughput across 33 benchmark runs.

Scalability (with SMT) on AMD Ryzen 7 5825U

Cross-core (no SMT) scalability on AMD Ryzen 7 5825U

Scalability (with SMT) on AMD Ryzen 9 5950X

Cross-core (no SMT) scalability on AMD Ryzen 9 5950X

Scalability on Intel i9-9900KS

Scalability on Intel Xeon Gold 6132

Latency Benchmark

One thread posts an integer to another thread through one queue and waits for a reply from another queue, 2 queues and 2 threads, in total. Each thread pings or pongs 500,000 messages into its egress queue. Contention is minimal here (1-producer-1-consumer, 1 element in the queue) in order to be able to achieve the lowest possible latency a queue can provide. This benchmark measures the total time taken to post 500,000 messages and receive 500,000 replies. A benchmark run reports the best sec/round-trip latency (time taken to push a message and pop its reply) out of 10 tries for each queue. The charts report mean, stdev, min and max of sec/round-trip latency across 33 benchmark runs.

Latency (with SMT) on AMD Ryzen 7 5825U

Cross-core (no SMT) latency on AMD Ryzen 7 5825U

Latency (with SMT) on AMD Ryzen 7 5950X

Cross-core (no SMT) latency on AMD Ryzen 7 5950X

Latency on Intel i9-9900KS

Latency on Intel Xeon Gold 6132

Systems details

AMD Ryzen 7 5825U system

AMD Ryzen 9 5950X system

Intel i9-9900KS system

Intel Xeon Gold 6132 system

Homepage

github.com/max0x7ba/atomic_queue