Skip to main content

Benchmarks

What ruststream-amqp costs on every message: throughput against the raw fe2o3-amqp client, and instructions and allocations of its code.

Against a raw client​

The first chart runs one scenario three ways on a real AMQP 1.0 broker, ActiveMQ Artemis. Raw client drives an fe2o3-amqp receiver directly. Broker crate drives this crate's subscription with a loop of its own and no runtime. RustStream is the service a user writes, a #[subscriber] handler in an app. The first gap is what this crate costs over the client it wraps, and the second is what the runtime adds on top.

Each loop is a bar from its best round to its slowest, with a dot at the best round and a notch at the median. The zero of the axis is the raw client's best round, and a dot right of zero is slower. A hollow dot is a loop whose difference from the raw client is smaller than the spread of the rounds. The table under the chart prints the best round with the median in parentheses.

A dot left of zero, where one appears, is a loop faster than the raw client. The raw loop holds one delivery at a time, and nothing reads the socket while it decodes and settles. This crate's subscription reads ahead into a channel as deep as the link credit, so the next delivery is already in hand when the loop asks for it.

Cost of the code​

The second chart counts what one message costs on the service's thread: instructions under callgrind and allocations under DHAT, in the steady state. Each scenario is a service on AmqpBroker against the same broker. The count includes the framework's dispatch, this crate's code and the fe2o3-amqp client's framing and decoding, which run on that thread as the connection's tasks. The broker is another process, and none of its work is counted. Cold start is what connecting the service, attaching its subscription and taking the first delivery cost once.

Results​

Against a raw clientHow far each loop falls below the raw client's best round
  • Raw client
  • Broker crate
  • RustStream
  • rounds, best to slowest
  • best round
  • median round
  • spread of the rounds
  • indistinguishable

ruststream-amqp 0.7.0 on ruststream 0.7.0, AMD Ryzen 9 7900X 12-Core Processor, Linux 7.2.10-x64v3-xanmod1-1, apache/activemq-artemis:latest-alpine in Docker on localhost, measured 2026-10-18. How the numbers were taken

queue, 512 B JSON, accept each
  • +2.5%
  • indistinguishable
Show the numbers as a table
ScenarioRaw clientBroker crateRustStreamOverhead
queue, 512 B JSON, accept each182,362 msg/s (182,123)177,811 msg/s (175,870) (+2.5% over the client)178,312 msg/s (176,666)indistinguishable
Cost of the code

AMD Ryzen 9 7900X 12-Core Processor, x86_64, 427-5912 MHz, 12 physical, 24 logical, 62.4 GiB, unknown, Linux 7.2.10-x64v3-xanmod1-1, 1.99.0, 3.25.1, bench, inheriting release (opt-level = 3, lto = fat, codegen-units = 16, debug = line-tables-only), ruststream-amqp default (none), ruststream macros,json. ruststream-amqp 0.7.0, ruststream 0.7.0, measured 2026-10-18.

Instructions
Allocations
queue, JSON decode into a small struct, accept each
28,063.9
17.1
reply through this crate's publisher, accepted by the broker
60,353.8
46.1
queue in batches of 64, assembled on the client
28,743.1
17.4
Show the numbers as a table
ScenarioInstructionsAllocationsCold start
queue, JSON decode into a small struct, accept each28,063.917.1222,777 / 228
reply through this crate's publisher, accepted by the broker60,353.846.1238,499 / 260
queue in batches of 64, assembled on the client28,743.117.4230,614 / 232

The machine​

ProcessorAMD Ryzen 9 7900X 12-Core Processor
Architecturex86_64
Frequency427-5912 MHz
Cores12 physical, 24 logical
Memory62.4 GiB
Memory speedunknown
Operating systemLinux 7.2.10-x64v3-xanmod1-1
Brokerapache/activemq-artemis:latest-alpine in Docker on localhost
Compiler1.99.0
Build profilebench, inheriting release (opt-level = 3, lto = fat, codegen-units = 16, debug = line-tables-only)
Featuresruststream-amqp default (none), ruststream macros,json
RUSTFLAGSnone (the recipe clears RUSTFLAGS, so the numbers are not tied to this CPU)
Round trip52 us (median of 20000 sends waiting for their disposition)
Valgrind3.25.1

The numbers come from docs/benchmarks/results.json of this version, written by the benchmark recipe. Methodology says how they were taken, and Numbers what they allow you to conclude.