| 1 |
# Benchmark Results |
| 2 |
|
| 3 |
Full benchmark results for go-sieve compared against |
| 4 |
[hashicorp/golang-lru](https://github.com/hashicorp/golang-lru) (LRU and ARC), |
| 5 |
plus trace-replay against real-world oracleGeneral cache traces. |
| 6 |
|
| 7 |
Every table below is generated by `bench/cmd/mktables` from the raw, |
| 8 |
metadata-stamped results files committed under `bench/results/` — no |
| 9 |
hand-curated numbers. Regenerate with: |
| 10 |
|
| 11 |
``` |
| 12 |
cd bench |
| 13 |
go run ./cmd/mktables -synth results/synthetic.txt \ |
| 14 |
-trace results/trace.txt -sweep results/sweep.txt |
| 15 |
``` |
| 16 |
|
| 17 |
## Machine |
| 18 |
|
| 19 |
| Field | Value | |
| 20 |
|-------|-------| |
| 21 |
| CPU | Apple M4 (4P + 6E cores) | |
| 22 |
| Cores / `GOMAXPROCS` | 10 | |
| 23 |
| OS | macOS (Darwin 25.5.0, arm64) | |
| 24 |
| Go | `go1.26.3 darwin/arm64` | |
| 25 |
| Trace data | oracleGeneral files under `data/` (13 MSR Cambridge 2007 + 5 Meta Storage block traces) | |
| 26 |
| Cache sizing | 10% of unique keys per trace | |
| 27 |
| Run date | 2026-06-10 | |
| 28 |
|
| 29 |
These numbers were run on Apple M4 after two benchmark-harness fixes: |
| 30 |
parallel trace walkers now start at **staggered ring offsets** (the old |
| 31 |
offset-0 lockstep walk inflated hit ratios and overstated the cold |
| 32 |
cold-replay margin), and the GC/memory benchmarks now report deltas |
| 33 |
over the timed loop instead of process-cumulative counters. Miss-ratio |
| 34 |
tables are unaffected (sequential replay, deterministic). |
| 35 |
|
| 36 |
## How These Were Generated |
| 37 |
|
| 38 |
The build-tag separation in `bench/` means each invocation runs exactly |
| 39 |
one benchmark set with no `-bench=FILTER` regex anywhere. Run in |
| 40 |
sequence, never concurrently: |
| 41 |
|
| 42 |
``` |
| 43 |
cd bench |
| 44 |
make bench # -> results/synthetic.txt (count=3) |
| 45 |
make trace # -> results/trace.txt (count=1) |
| 46 |
make sweep SWEEP_PROCS="1 2 4 8 10" # -> results/sweep.txt |
| 47 |
``` |
| 48 |
|
| 49 |
Each results file begins with a `#`-prefixed header recording date, |
| 50 |
host, CPU, core count, Go version, and git commit. |
| 51 |
|
| 52 |
## Tables |
| 53 |
|
| 54 |
### Parallel Get throughput (warm cache, ns/op) |
| 55 |
|
| 56 |
Cache pre-warmed with a full replay; goroutines start at staggered trace offsets. |
| 57 |
|
| 58 |
| Trace | SIEVE k=1 | SIEVE k=3 | LRU | ARC | |
| 59 |
|-------|---------:|---------:|----:|----:| |
| 60 |
| msr_2007/msr_web_2 | **2.24** | 2.05 | 105.7 | 150.4 | |
| 61 |
| msr_2007/msr_proj_4 | **2.84** | 3.87 | 157.4 | 220.8 | |
| 62 |
| msr_2007/msr_prxy_0 | **3.28** | 3.15 | 106.3 | 133.3 | |
| 63 |
| msr_2007/msr_prn_1 | **3.51** | 3.37 | 135.9 | 185.8 | |
| 64 |
| meta_storage/block_traces_2 | **4.01** | 4.31 | 129.4 | 211.4 | |
| 65 |
| meta_storage/block_traces_1 | **4.03** | 4.34 | 132.5 | 197.9 | |
| 66 |
| msr_2007/msr_usr_2 | **4.62** | 4.79 | 209.4 | 268.5 | |
| 67 |
| meta_storage/block_traces_4 | **4.88** | 4.87 | 159.2 | 250.5 | |
| 68 |
| meta_storage/block_traces_3 | **4.95** | 4.56 | 147.2 | 224.8 | |
| 69 |
| meta_storage/block_traces_5 | **5.00** | 4.92 | 152.2 | 222.5 | |
| 70 |
| msr_2007/msr_src1_0 | **5.65** | 5.60 | 157.4 | 384.9 | |
| 71 |
| msr_2007/msr_usr_1 | **6.39** | 7.73 | 252.6 | 308.0 | |
| 72 |
| msr_2007/msr_src1_1 | **7.04** | 7.20 | 165.9 | 276.9 | |
| 73 |
| msr_2007/msr_proj_1 | **7.31** | 7.21 | 255.1 | 307.3 | |
| 74 |
| msr_2007/msr_proj_0 | **8.15** | 8.55 | 110.4 | 136.9 | |
| 75 |
| msr_2007/msr_hm_0 | **9.12** | 9.38 | 117.6 | 141.8 | |
| 76 |
| msr_2007/msr_proj_2 | **10.09** | 7.96 | 260.1 | 299.6 | |
| 77 |
| msr_2007/msr_prn_0 | **12.20** | 12.34 | 173.2 | 154.2 | |
| 78 |
|
| 79 |
### Parallel Replay throughput (cold cache, mixed read+write, ns/op) |
| 80 |
|
| 81 |
Probe() for SIEVE, Get+Add for LRU/ARC; no warmup; staggered trace offsets. |
| 82 |
|
| 83 |
| Trace | SIEVE k=1 | SIEVE k=3 | LRU | ARC | |
| 84 |
|-------|---------:|---------:|----:|----:| |
| 85 |
| msr_2007/msr_prxy_0 | **37.41** | 36.63 | 229.3 | 251.1 | |
| 86 |
| msr_2007/msr_hm_0 | **58.69** | 61.00 | 228.9 | 297.9 | |
| 87 |
| msr_2007/msr_prn_0 | **62.18** | 67.62 | 251.6 | 322.3 | |
| 88 |
| msr_2007/msr_proj_0 | **62.97** | 58.63 | 236.2 | 312.2 | |
| 89 |
| msr_2007/msr_usr_1 | **73.57** | 80.44 | 376.8 | 391.2 | |
| 90 |
| msr_2007/msr_prn_1 | **90.43** | 91.50 | 351.7 | 390.4 | |
| 91 |
| msr_2007/msr_proj_4 | **110.0** | 113.5 | 425.1 | 563.9 | |
| 92 |
| msr_2007/msr_proj_1 | **118.6** | 121.3 | 447.0 | 505.6 | |
| 93 |
| meta_storage/block_traces_1 | **134.2** | 160.0 | 277.2 | 351.6 | |
| 94 |
| meta_storage/block_traces_2 | **137.9** | 179.4 | 300.5 | 374.9 | |
| 95 |
| msr_2007/msr_web_2 | **155.5** | 145.4 | 478.4 | 513.7 | |
| 96 |
| meta_storage/block_traces_4 | **156.2** | 179.2 | 371.8 | 384.8 | |
| 97 |
| meta_storage/block_traces_5 | **157.4** | 178.1 | 336.2 | 377.9 | |
| 98 |
| meta_storage/block_traces_3 | **158.4** | 178.6 | 312.7 | 380.4 | |
| 99 |
| msr_2007/msr_src1_0 | **219.3** | 200.8 | 628.9 | 588.3 | |
| 100 |
| msr_2007/msr_usr_2 | **222.3** | 215.6 | 627.7 | 579.9 | |
| 101 |
| msr_2007/msr_proj_2 | **252.3** | 265.0 | 528.3 | 527.5 | |
| 102 |
| msr_2007/msr_src1_1 | **274.7** | 274.2 | 652.3 | 633.4 | |
| 103 |
|
| 104 |
### Sequential replay (full trace per iteration, wall time) |
| 105 |
|
| 106 |
| Trace | SIEVE k=1 | SIEVE k=3 | LRU | ARC | |
| 107 |
|-------|---------:|---------:|----:|----:| |
| 108 |
| msr_2007/msr_proj_0 | **105.40 ms** | 121.14 ms | 171.05 ms | 402.34 ms | |
| 109 |
| msr_2007/msr_hm_0 | **114.15 ms** | 113.41 ms | 184.53 ms | 393.85 ms | |
| 110 |
| msr_2007/msr_prn_0 | **126.75 ms** | 150.50 ms | 222.36 ms | 579.91 ms | |
| 111 |
| msr_2007/msr_prxy_0 | **137.39 ms** | 174.28 ms | 338.02 ms | 584.97 ms | |
| 112 |
| msr_2007/msr_web_2 | **304.64 ms** | 304.81 ms | 454.83 ms | 1238.67 ms | |
| 113 |
| msr_2007/msr_proj_4 | **396.78 ms** | 393.40 ms | 563.30 ms | 1665.27 ms | |
| 114 |
| msr_2007/msr_prn_1 | **655.26 ms** | 548.70 ms | 797.64 ms | 2225.59 ms | |
| 115 |
| msr_2007/msr_usr_2 | **876.51 ms** | 1014.49 ms | 1513.14 ms | 3392.54 ms | |
| 116 |
| meta_storage/block_traces_1 | **1226.83 ms** | 1238.43 ms | 1057.55 ms | 3372.92 ms | |
| 117 |
| meta_storage/block_traces_3 | **1288.96 ms** | 1389.75 ms | 1397.24 ms | 4081.92 ms | |
| 118 |
| meta_storage/block_traces_4 | **1321.39 ms** | 1456.50 ms | 1416.97 ms | 4233.27 ms | |
| 119 |
| meta_storage/block_traces_2 | **1418.15 ms** | 1340.43 ms | 1130.64 ms | 3521.09 ms | |
| 120 |
| meta_storage/block_traces_5 | **1465.93 ms** | 1605.81 ms | 1741.38 ms | 4488.38 ms | |
| 121 |
| msr_2007/msr_usr_1 | **3173.14 ms** | 3420.78 ms | 5660.10 ms | 11779.53 ms | |
| 122 |
| msr_2007/msr_proj_1 | **3460.30 ms** | 3313.95 ms | 5221.92 ms | 9907.45 ms | |
| 123 |
| msr_2007/msr_src1_1 | **4748.55 ms** | 4905.35 ms | 5277.09 ms | 22840.51 ms | |
| 124 |
| msr_2007/msr_src1_0 | **4812.44 ms** | 4265.30 ms | 4308.28 ms | 15030.22 ms | |
| 125 |
| msr_2007/msr_proj_2 | **5357.95 ms** | 5274.71 ms | 7483.62 ms | 13821.55 ms | |
| 126 |
|
| 127 |
### Miss ratio (every trace) |
| 128 |
|
| 129 |
Cache sized at 10% of unique keys. **Bold** = best in row. |
| 130 |
|
| 131 |
| Trace | SIEVE k=1 | SIEVE k=2 | SIEVE k=3 | LRU | ARC | |
| 132 |
|-------|----------:|----------:|----------:|----:|----:| |
| 133 |
| meta_storage/block_traces_1 | 0.4632 | 0.4651 | 0.4672 | **0.4602** | 0.4667 | |
| 134 |
| meta_storage/block_traces_2 | 0.4719 | 0.4743 | 0.4754 | **0.4676** | 0.4755 | |
| 135 |
| meta_storage/block_traces_3 | 0.4908 | 0.4928 | 0.4948 | **0.4885** | 0.4947 | |
| 136 |
| meta_storage/block_traces_4 | 0.4841 | 0.4870 | 0.4888 | **0.4812** | 0.4887 | |
| 137 |
| meta_storage/block_traces_5 | 0.4959 | 0.4984 | 0.4998 | **0.4927** | 0.5003 | |
| 138 |
| msr_2007/msr_hm_0 | 0.2991 | 0.3025 | 0.3025 | 0.3188 | **0.2923** | |
| 139 |
| msr_2007/msr_prn_0 | 0.2156 | 0.2194 | 0.2208 | 0.2310 | **0.2145** | |
| 140 |
| msr_2007/msr_prn_1 | 0.3908 | 0.3837 | **0.3796** | 0.4341 | 0.4148 | |
| 141 |
| msr_2007/msr_proj_0 | 0.2537 | 0.2660 | 0.2745 | 0.2375 | **0.2242** | |
| 142 |
| msr_2007/msr_proj_1 | 0.6794 | 0.6794 | 0.6794 | 0.7215 | **0.6788** | |
| 143 |
| msr_2007/msr_proj_2 | 0.8231 | 0.8231 | 0.8231 | 0.8548 | **0.8125** | |
| 144 |
| msr_2007/msr_proj_4 | 0.8463 | 0.8463 | 0.8463 | 0.8140 | **0.7173** | |
| 145 |
| msr_2007/msr_prxy_0 | 0.0512 | 0.0572 | 0.0594 | 0.0476 | **0.0468** | |
| 146 |
| msr_2007/msr_src1_0 | 0.7845 | 0.7845 | 0.7845 | 0.9132 | **0.7811** | |
| 147 |
| msr_2007/msr_src1_1 | 0.7939 | **0.7934** | 0.7934 | 0.8129 | 0.8231 | |
| 148 |
| msr_2007/msr_usr_1 | 0.3558 | 0.3558 | 0.3558 | 0.4007 | **0.3513** | |
| 149 |
| msr_2007/msr_usr_2 | 0.7216 | 0.7216 | 0.7216 | 0.7533 | **0.7199** | |
| 150 |
| msr_2007/msr_web_2 | 0.9786 | 0.9786 | 0.9786 | 0.9929 | **0.9785** | |
| 151 |
|
| 152 |
Derived (computed by mktables, n=18 traces): |
| 153 |
- Best-in-row counts: sieve-k2: 1, sieve-k3: 1, LRU: 5, ARC: 11 |
| 154 |
- Head-to-head SIEVE k=1 vs LRU: k=1 lower on 10, LRU lower on 8, tied on 0 |
| 155 |
|
| 156 |
### GC pressure during replay (trace: meta_storage/block_traces_1) |
| 157 |
|
| 158 |
| Variant | NumGC | PauseTotal (µs) | TotalAlloc (KB) | HeapObjects | |
| 159 |
|---------|------:|----------------:|----------------:|------------:| |
| 160 |
| sieve-k1 | 1 | 96 | 135022 | 509 | |
| 161 |
| sieve-k3 | 1 | 42 | 135185 | 509 | |
| 162 |
| LRU | 1 | 40 | 417926 | 508 | |
| 163 |
| ARC | 1 | 46 | 996709 | 508 | |
| 164 |
|
| 165 |
### Synthetic parallel micro-benchmarks (medians) |
| 166 |
|
| 167 |
| Benchmark | Sieve | LRU | ARC | |
| 168 |
|-----------|-------|-----|-----| |
| 169 |
| `Get_Parallel` | 5.76 ns/op, 0 B | 144.2 ns/op, 0 B | 144.9 ns/op, 0 B | |
| 170 |
| `Add_Parallel` | 89.76 ns/op, 8 B | 212.0 ns/op, 40 B | 273.3 ns/op, 74 B | |
| 171 |
| `Probe_Parallel` | 91.21 ns/op, 8 B | — | — | |
| 172 |
| `Delete_Parallel` | 81.18 ns/op, 0 B | 69.54 ns/op, 0 B | 88.33 ns/op, 0 B | |
| 173 |
| `Mixed_Parallel` (60/30/10) | 70.99 ns/op, 2 B | 162.2 ns/op, 12 B | 211.8 ns/op, 23 B | |
| 174 |
| `Zipf_Get_Parallel` (s=1.01) | 24.72 ns/op, 0 B | 127.7 ns/op, 2 B | 133.1 ns/op, 2 B | |
| 175 |
| `Zipf_Get_Parallel` (s=1.20) | 58.34 ns/op, 0 B | 115.6 ns/op, 2 B | 125.0 ns/op, 2 B | |
| 176 |
| `Zipf_Get_Parallel` (s=1.50) | 94.19 ns/op, 1 B | 100.4 ns/op, 1 B | 112.6 ns/op, 2 B | |
| 177 |
|
| 178 |
### Memory footprint at fill (median heap-bytes) |
| 179 |
|
| 180 |
| Entries | Sieve | LRU | ARC | |
| 181 |
|---------|------:|----:|----:| |
| 182 |
| 100K | 6.6 MB | 9.9 MB | 9.9 MB | |
| 183 |
| 500K | 39.2 MB | 56.2 MB | 56.2 MB | |
| 184 |
| 1M | 78.4 MB | 112.4 MB | 112.3 MB | |
| 185 |
|
| 186 |
### GC impact at 1M entries (median) |
| 187 |
|
| 188 |
| Variant | wall/iter | avg GC pause | |
| 189 |
|---------|----------:|-------------:| |
| 190 |
| Sieve | 4.37 ms | 18.1 µs | |
| 191 |
| LRU | 9.46 ms | 22.4 µs | |
| 192 |
| ARC | 9.93 ms | 23.5 µs | |
| 193 |
|
| 194 |
### Core scaling: Get_Parallel (median ns/op) |
| 195 |
|
| 196 |
| GOMAXPROCS | Sieve | LRU | ARC | |
| 197 |
|-----------:|------:|----:|----:| |
| 198 |
| 1 | 14.93 | 31.35 | 33.79 | |
| 199 |
| 2 | 8.92 | 74.25 | 76.97 | |
| 200 |
| 4 | 5.52 | 121.1 | 146.0 | |
| 201 |
| 8 | 7.96 | 178.7 | 182.0 | |
| 202 |
| 10 | 7.53 | 182.1 | 193.4 | |
| 203 |
|
| 204 |
### Core scaling: Mixed_Parallel (median ns/op) |
| 205 |
|
| 206 |
| GOMAXPROCS | Sieve | LRU | ARC | |
| 207 |
|-----------:|------:|----:|----:| |
| 208 |
| 1 | 33.32 | 59.36 | 95.47 | |
| 209 |
| 2 | 44.18 | 85.91 | 126.3 | |
| 210 |
| 4 | 60.58 | 152.6 | 165.5 | |
| 211 |
| 8 | 87.85 | 205.8 | 261.9 | |
| 212 |
| 10 | 92.29 | 222.8 | 277.4 | |
| 213 |
|
| 214 |
### Core scaling: Zipf_Get_Parallel/s=1.01 (median ns/op) |
| 215 |
|
| 216 |
| GOMAXPROCS | Sieve | LRU | ARC | |
| 217 |
|-----------:|------:|----:|----:| |
| 218 |
| 1 | 9.93 | 21.25 | 25.32 | |
| 219 |
| 2 | 8.21 | 62.80 | 67.34 | |
| 220 |
| 4 | 10.22 | 133.9 | 140.8 | |
| 221 |
| 8 | 23.96 | 156.7 | 165.7 | |
| 222 |
| 10 | 26.62 | 169.5 | 181.6 | |
| 223 |
|
| 224 |
### Headlines (computed) |
| 225 |
|
| 226 |
- Warm parallel Get (SIEVE k=1): 2.24–12.20 ns/op across 18 traces; 13x–55x faster than the better of LRU/ARC per trace |
| 227 |
- Cold parallel replay (SIEVE k=1): 37.4–274.7 ns/op across 18 traces; 2.0x–6.1x faster than the better of LRU/ARC per trace |
| 228 |
|