Skip to main content

Benchmarks

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

Against a raw client​

The first chart runs two scenarios three ways on a stream file on this machine's disk. Raw client drives the sea-streamer-file streamer, consumer and producer directly. Broker crate drives this crate's subscription and publisher 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: a dot right of zero is slower, and a dot left of it is faster. 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.

The two scenarios are the two ways a stream file is read. A replay reads a file written in full before the subscription opened, and nothing paces it. A live tail follows a file still being appended to, and every delivery waits for an append.

On the replay row RustStream comes out faster than the raw client, and the crate's own loop matches it. The crate's subscription reads ahead on a task of its own, so the next message is out of the file while the current one is handled. The hand-written raw loop reads and handles in one task.

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 FileBroker over a stream file of its own. The count includes the framework's dispatch, this crate's code and the part of the client that runs on that thread. The client's writer and the file reads and writes on tokio's blocking threads are not counted. Cold start is what starting the service and taking the first message cost once.

Results​

Against a raw clientEach loop against the raw client's best round: right of zero is slower, left is faster
  • Raw client
  • Broker crate
  • RustStream
  • rounds, best to slowest
  • best round
  • median round
  • spread of the rounds
  • indistinguishable

ruststream-sea-file 0.7.0 on ruststream 0.7.0, AMD Ryzen 9 7900X 12-Core Processor, Linux 7.2.11-x64v3-xanmod1-1, none: the transport is a stream file on this machine's filesystem, measured 2026-10-18. How the numbers were taken

replay of a recorded stream file, 512 B JSON
  • indistinguishable
  • -41.4%
live tail of a file being appended to, 512 B JSON
  • indistinguishable
  • +3.3% (storage-bound)
Show the numbers as a table
ScenarioRaw clientBroker crateRustStreamOverhead
replay of a recorded stream file, 512 B JSON226,428 msg/s (206,683)227,695 msg/s (225,547) (indistinguishable against the client)320,151 msg/s (313,104)-41.4%
live tail of a file being appended to, 512 B JSON68,880 msg/s (68,702)68,090 msg/s (67,417) (indistinguishable against the client)66,630 msg/s (65,933)+3.3% (storage-bound)
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.11-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-sea-file default (none), ruststream macros,json. ruststream-sea-file 0.7.0, ruststream 0.7.0, measured 2026-10-18.

Instructions
Allocations
consume, JSON decode into a small struct
52,957
32.5
reply, appended to the same file by this crate's publisher
81,033.3
73.3
consume in batches of 64, assembled on the client
52,971.1
32.5
Show the numbers as a table
ScenarioInstructionsAllocationsCold start
consume, JSON decode into a small struct52,95732.5194,100 / 236
reply, appended to the same file by this crate's publisher81,033.373.3196,968 / 245
consume in batches of 64, assembled on the client52,971.132.5221,502 / 247

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.11-x64v3-xanmod1-1
Brokernone: the transport is a stream file on this machine's filesystem
Filesystembtrfs on /dev/nvme2n1p1
Stream file size0.71 GiB per run at its largest
Page cachewarm: every run writes its stream file immediately before reading it back, so the figures are the filesystem's rather than the device's
One append18.0 us per flushed append
Compiler1.99.0
Build profilebench, inheriting release (opt-level = 3, lto = fat, codegen-units = 16, debug = line-tables-only)
Featuresruststream-sea-file default (none), ruststream macros,json
RUSTFLAGSnone (the recipe clears RUSTFLAGS, so the numbers are not tied to this CPU)
Valgrind3.25.1

The transport is a file, so the filesystem takes the place of a broker's server, and the numbers belong to it as much as to this crate. One append is the time of one append flushed to the file, measured on its own.

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.