# Runtime-shaped workloads
Date: 2026-08-15
Status: current application-shaped Windows/Linux checkpoint
These workloads test cross-thread ownership and generational-runtime behavior.
They do not implement a garbage collector and do not replace end-to-end runtime
measurements.
## Workloads
`service` models bidirectional actor/RPC traffic. Each client/server pair
exchanges batches of objects from 48 bytes through 16 KiB. The peer reads and
releases each object, while one object in sixteen survives for eight waves. A
reported request unit includes one request and one response object.
`runtime-gc` models a thread-local generational runtime. Each wave allocates and
initializes 32-, 96-, 256-, and 1,024-byte objects, visits older survivors,
retains 10% for eight waves, and reclaims other newborns from the allocation
frontier toward older addresses. `runtime-gc-forward` performs identical work
but reclaims newborns oldest-first as a locality control.
The timed interval excludes allocator statistics and validation. Every bomalloc
run must finish with zero requested live bytes and pass the complete invariant
validator.
## Method
- Intel Core i7-12700K, 20 logical CPUs;
- Windows NT 10.0.26200.0, Rust 1.86 MSVC Release;
- Debian 11 under WSL2 kernel `6.18.33.2-microsoft-standard-WSL2`;
- compact affinity on the first 16 logical CPUs for 16-thread runs;
- 500,000 service request units per pair or approximately 500,000 runtime
allocations per worker;
- five fresh processes per allocator with rotated order; tables show medians;
- Linux comparators: glibc 2.31, jemalloc 5.2.1, and mimalloc 2.3.2;
- Windows comparator: Rust `System` backed by the platform heap.
## Bidirectional service
Higher request rate is better.
| Windows | 2 | **5.752 M/s** | - | - | 5.571 M/s | 0.968x |
| Windows | 16 | 3.687 M/s | - | - | **35.306 M/s** | **9.58x** |
| Linux | 2 | 0.968 M/s | 0.976 M/s | 1.128 M/s | **1.140 M/s** | **1.011x** |
| Linux | 16 | 5.593 M/s | 5.592 M/s | **6.859 M/s** | 6.611 M/s | 0.964x |
Latency cells are `p50 / p99` nanoseconds per request object.
| Windows | 2 | 109 / 1,762 | - | - | 128 / **396** |
| Windows | 16 | 1,975 / 5,171 | - | - | **131 / 403** |
| Linux | 2 | 969 / 2,233 | 967 / 2,200 | 839 / **1,867** | **821** / 1,963 |
| Linux | 16 | 1,237 / 2,499 | 1,227 / 2,512 | **1,024 / 2,079** | 1,056 / 2,158 |
Bomalloc's owner-local allocation plus direct foreign publication scales well
when ownership crosses threads. At sixteen Linux threads it remains 3.6% behind
mimalloc; at sixteen Windows threads it avoids the platform allocator's scaling
collapse in this workload.
## Generational runtime model
A unit includes allocation, initialization, survivor scanning, reclamation, and
periodic generation expiry.
| Windows | 1 | 18.31 M/s | - | - | **31.41 M/s** | **1.72x** |
| Windows | 16 | 53.20 M/s | - | - | **143.09 M/s** | **2.69x** |
| Linux | 1 | 7.74 M/s | 29.29 M/s | **63.90 M/s** | 33.91 M/s | 0.531x |
| Linux | 16 | 20.89 M/s | **154.72 M/s** | 138.79 M/s | 141.92 M/s | 0.917x |
Latency cells are `p50 / p99` nanoseconds per allocation unit averaged over a
complete wave.
| Windows | 1 | 46 / 150 | - | - | **29 / 49** |
| Windows | 16 | 250 / 1,394 | - | - | **87 / 615** |
| Linux | 1 | 125 / 192 | 29 / 66 | **14 / 27** | 26 / 44 |
| Linux | 16 | 765 / 1,811 | **89 / 365** | 108 / **247** | 95 / 514 |
At sixteen Linux threads bomalloc is 8.3% behind jemalloc and 2.3% ahead of
mimalloc in rate. Its p99 still trails both. At one Linux thread mimalloc is
1.88x faster, so this result supports the multi-thread design goal rather than a
universal local-path claim.
## Frontier-order control
This A/B changes only newborn reclamation order.
| Windows | 1 | 31.41 M/s | 30.43 M/s | +3.2% |
| Windows | 16 | 143.09 M/s | 134.14 M/s | +6.7% |
| Linux | 1 | 33.91 M/s | 33.37 M/s | +1.6% |
| Linux | 16 | 141.92 M/s | 120.29 M/s | **+18.0%** |
At sixteen Linux threads reverse reclamation also reduces bomalloc's median
committed working set from 101.5 MiB to 98.6 MiB and p99 from 563 ns to 514 ns.
Allocation-order locality is real but not unique to bomalloc: the same control
also moves platform and comparator results.
## Space cost
Committed capacity is compared with the modeled nursery crest, not only with the
smaller post-reclamation survivor set.
| Windows service | not sampled | not sampled | 8.0 MiB | 96 MiB | - |
| Linux service | not sampled | not sampled | 8.0 MiB | 96 MiB | - |
| Windows runtime-GC | 33.6 MiB | 73.8 MiB | 99.4 MiB | 112 MiB | 1.35x |
| Linux runtime-GC | 33.6 MiB | 73.8 MiB | 98.6 MiB | 112 MiB | 1.34x |
Windows process peak RSS was 15.7 MiB for bomalloc versus 10.0 MiB for System on
service, and 117.7 MiB versus 178.4 MiB on runtime-GC. Comparable external Linux
RSS was not collected for this checkpoint.
## Runtime-GC configuration preset
`Config::runtime_gc()` raises the existing owner-only magazine ceiling from
eight to sixteen. The release binary and allocation code layout are unchanged;
only the input configuration differs. Windows used 31 alternating pairs and
Linux used 15 pairs for the 16-thread, one-nursery-phase birth test.
| Windows | 8 | 162.55 M/s | 556 ns | 103,168 KiB | baseline |
| Windows | 16 | **163.86 M/s** | **540 ns** | **102,336 KiB** | rate +0.8%, p99 -2.9%, committed -0.8% |
| Linux | 8 | 117.32 M/s | 690 ns | 104,512 KiB | baseline |
| Linux | 16 | **121.35 M/s** | **659 ns** | **102,080 KiB** | rate +3.4%, p99 -4.5%, committed -2.3% |
The arrays already have sixteen compiled slots and adaptive fill still begins at
one. The setting remains opt-in because Windows guardrails show small regressions
for some general workloads:
| local | 670.07 M/s | 778.35 M/s | +16.2% | 29 ns to 25 ns |
| burst | 694.73 M/s | 671.38 M/s | -3.4% | unchanged at 28 ns |
| mixed | 357.11 M/s | 352.54 M/s | -1.3% | 50 ns to 46 ns |
| remote | 174.42 M/s | 171.39 M/s | -1.7% | not sampled |
| service | 36.53 M/s | 36.97 M/s | +1.2% | unchanged at 387 ns |
## Reproduction
Windows:
```powershell
$env:BOMALLOC_BENCH_WORKLOAD='runtime-gc'
$env:BOMALLOC_BENCH_THREADS='16'
$env:BOMALLOC_BENCH_ITERS='500000'
$env:BOMALLOC_BENCH_AFFINITY='compact'
$env:BOMALLOC_BENCH_MAGAZINE='16'
cargo bench --bench multithread
```
Linux:
```bash
BOMALLOC_BENCH_WORKLOAD=runtime-gc \
BOMALLOC_BENCH_THREADS=16 \
BOMALLOC_BENCH_ITERS=500000 \
BOMALLOC_BENCH_RUNS=5 \
BOMALLOC_BENCH_AFFINITY=compact \
BOMALLOC_BENCH_NURSERY_PHASES=1 \
BOMALLOC_BENCH_MAGAZINE=16 \
bash scripts/linux-allocator-bench.sh
```
## Assessment
Bomalloc is competitive in the tested multi-thread service and runtime-shaped
workloads, but is not generally superior to modern allocators. Linux
single-thread runtime performance and sixteen-thread p99 remain behind mimalloc
or jemalloc. A real runtime integration is still required to measure mutator
throughput, pause time, and complete collector behavior.