Benchmarks
What ruststream-kinesis costs on every record: throughput against the raw aws-sdk-kinesis
client, and instructions and allocations of its code.
Against a raw client
The first chart runs each scenario three ways against the same Kinesis endpoint. Raw client
drives aws-sdk-kinesis 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.
Both scenarios read one shard and checkpoint every record. They differ in where the checkpoint goes: the first keeps it in process, as the default lease store does, and the second writes it to a DynamoDB table with a conditional write. The raw loop writes the same checkpoint to the same place, so what separates the two rows is the store, not the crate.
Cost of the code
The second chart counts what one record costs on the service's thread: instructions under
callgrind and allocations under DHAT, in the steady state. Each scenario is a service on
KinesisBroker against the same endpoint, with the
default lease store. The count includes the framework's dispatch and this crate's code. It also
includes the AWS SDK's work on that thread: building and signing every request, the HTTP exchange
and parsing every answer. That work is most of every figure, and nearly all of the reply row, so
these numbers are not comparable with those of a broker whose client works on threads of its own.
Cold start is what connecting, opening the subscription, listing the shard, taking its lease and
its iterator, and taking the first record cost once.
Results
- Raw client
- Broker crate
- RustStream
- rounds, best to slowest
- best round
- median round
- spread of the rounds
- indistinguishable
ruststream-kinesis 0.7.0 on ruststream 0.7.0, AMD Ryzen 9 7900X 12-Core Processor, Linux 7.2.11-x64v3-xanmod1-1, localstack/localstack:4.14.0 (Kinesis and DynamoDB emulator) in Docker on localhost, not AWS, measured 2026-10-18. How the numbers were taken
- indistinguishable
- indistinguishable
- indistinguishable
- indistinguishable
Show the numbers as a table
| Scenario | Raw client | Broker crate | RustStream | Overhead |
|---|---|---|---|---|
| one shard, 512 B JSON, in-process checkpoints | 358 msg/s (342) | 363 msg/s (346) (indistinguishable over the client) | 365 msg/s (340) | indistinguishable |
| one shard, 512 B JSON, DynamoDB checkpoints | 75 msg/s (75) | 79 msg/s (74) (indistinguishable over the client) | 77 msg/s (77) | indistinguishable |
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-kinesis dynamodb-lease, ruststream macros,json. ruststream-kinesis 0.7.0, ruststream 0.7.0, measured 2026-10-18.
Show the numbers as a table
| Scenario | Instructions | Allocations | Cold start |
|---|---|---|---|
| one shard, JSON decode into a small struct, ack each | 16,367.6 | 12.5 | 3,952,857 / 4,249 |
| one shard, reply with PutRecord through this crate's default policy | 368,050.9 | 395.6 | 4,236,029 / 4,579 |
| one shard, batches of 64, one read per batch | 21,572.3 | 18.3 | 4,028,415 / 4,310 |
The machine
| Processor | AMD Ryzen 9 7900X 12-Core Processor |
|---|---|
| Architecture | x86_64 |
| Frequency | 427-5912 MHz |
| Cores | 12 physical, 24 logical |
| Memory | 62.4 GiB |
| Memory speed | unknown |
| Operating system | Linux 7.2.11-x64v3-xanmod1-1 |
| Emulator | localstack/localstack:4.14.0 (Kinesis and DynamoDB emulator) in Docker on localhost, not AWS |
| Round trip | 4.755 ms (DescribeStreamSummary, 2104 calls on one client) |
| Compiler | 1.99.0 |
| Build profile | bench, inheriting release (opt-level = 3, lto = fat, codegen-units = 16, debug = line-tables-only) |
| Features | ruststream-kinesis dynamodb-lease, ruststream macros,json |
| RUSTFLAGS | none (the recipe clears RUSTFLAGS, so the numbers are not tied to this CPU) |
| Valgrind | 3.25.1 |
The numbers come from docs/benchmarks/results.json of this version, written by the benchmark
recipes. Methodology says how they were taken, and Numbers what
they allow you to conclude.