CPU scaling benchmark
workers
3 +1 main
iters total
500M
125000000/stream
elapsed
1114.18 ms
total CPU used
4353.34 ms
speedup
3.91×
vs serial
efficiency
97.8%
of 4× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 5.48 | 5.49 | 1085.1 | 1079.61 | 0 |
| 1 | 2.128 | 2.14 | 17.8 | 1110.92 | 1093.12 | 27.99 |
| 2 | 1.692 | 3.85 | 17.84 | 1108.09 | 1090.25 | 29.03 |
| 3 | 1.608 | 5.47 | 17.62 | 1107.98 | 1090.36 | 23.01 |
main
w1
w2
w3
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.