CPU scaling benchmark
workers
4 +1 main
iters total
500M
100000000/stream
elapsed
1259.06 ms
total CPU used
5357.55 ms
speedup
4.26×
vs serial
efficiency
85.2%
of 5× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 7.49 | 7.51 | 1216.83 | 1209.32 | 0 |
| 1 | 1.905 | 1.92 | 18.05 | 997.39 | 979.34 | 0.12 |
| 2 | 1.533 | 3.48 | 20.1 | 939.4 | 919.3 | 0.18 |
| 3 | 2.201 | 5.7 | 26.76 | 1060 | 1033.24 | 0.2 |
| 4 | 1.748 | 7.47 | 39.92 | 1256.27 | 1216.35 | 39.58 |
main
w1
w2
w3
w4
fork+handshake
CPU work
parent reap wait
what this measures
Each stream runs a tight integer LCG loop — working set is one CPU register, no memory access,
no shared data. Speedup = sum(stream CPU time) / wall-clock elapsed. Efficiency = speedup / (workers+1).
100% efficiency means perfect linear scaling; less than 100% is the cost of serial fork setup,
reap tail, SMT/core contention.