Scalability Benchmark

N producer threads push a 4-byte integer into one same queue, N consumer threads pop the integers from the queue. Time taken to send and receive a total of 1,000,000 messages through one queue 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 3 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 (with SMT) on Intel i9-9900KS

Scalability (with SMT) 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 and repeats. There are 2 queues and 2 threads, and only one message exist at any given time. In total, each thread pushes 500,000 messages into its egress queue, and pops 500,000 from its ingress 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 3 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 (with SMT) on Intel i9-9900KS

Latency (with SMT) 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