Speed Demon 2026: Cause Of Death
This book is my Speed Demon 2026 entry, one chapter per track. It’s all Rust with no crates, and every output hashes the same as the reference on every seed I tested. Here’s where each track landed, going by the final code’s best board run on the public dataset (seed 1):
| Track | Reference | Mine | Memory | Lines | Points |
|---|---|---|---|---|---|
| A: Ingest | 32.05 s | 16.6 ms | 16.9 MB | 344 | 87.6 |
| B: Index | 56.35 s | 87.3 ms | 42.1 MB | 961 | 79.6 |
| C: Join | 14.44 s | 19.3 ms | 11.3 MB | 348 | 83.1 |
| D: Traverse | 72.69 s | 118.4 ms | 65.7 MB | 424 | 73.6 |
Ideas every track shares
- Every program
mmaps/dataread-only and walks the bytes with one cursor, so no line is ever copied into a string and the page cache is never read twice. - Each one runs a single team of 12 threads. The input is cut into one chunk per thread at safe points, and the work goes in phases with short serial steps in between.
- The data gets packed small: A turns 239 MB of log into 12 MB of 4-byte records, B indexes only the terms its queries use, C measures escaped fields without ever rewriting them, and D squeezes an edge into 4 bytes.
- Answers are exact, and the output hash checks that. Percentiles are nearest rank on a counting sort, sums are integers merged in a fixed order, and D’s search is plain Dijkstra on integer weights. Nothing depends on how the threads get scheduled.
- There’s no teardown. Each process exits right after its write, and by then the threads have
handed their mappings back to the kernel in parallel, so
munmapat exit has nothing left to do.
How a chapter works
Each chapter is that track’s README.md followed by its PERF.md, pulled straight from the repo
when the book builds, so the site can’t drift from the code. The logs keep the experiments that
failed too, with their numbers, because that’s the part that’s hardest to piece together later.