CPU scaling benchmark
workers
4 +1 main
iters total
500M
100000000/stream
elapsed
1228 ms
total CPU used
5228.64 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 | 6.29 | 6.3 | 1171.02 | 1164.72 | 0 |
| 1 | 1.878 | 1.89 | 17.14 | 890.48 | 873.34 | 0.13 |
| 2 | 1.51 | 3.43 | 17.91 | 974.84 | 956.93 | 0.19 |
| 3 | 1.334 | 4.78 | 19.95 | 1063.57 | 1043.62 | 0.21 |
| 4 | 1.475 | 6.28 | 35.21 | 1225.24 | 1190.03 | 54.35 |
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.