CPU scaling benchmark
workers
3 +1 main
iters total
500M
125000000/stream
elapsed
1141.56 ms
total CPU used
4380.59 ms
speedup
3.84×
vs serial
efficiency
96%
of 4× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 5.32 | 5.33 | 1085.55 | 1080.22 | 0 |
| 1 | 2.004 | 2.02 | 14.41 | 1104.19 | 1089.78 | 18.78 |
| 2 | 1.629 | 3.67 | 15.21 | 1138.78 | 1123.57 | 53.36 |
| 3 | 1.617 | 5.31 | 17.44 | 1104.46 | 1087.02 | 24.42 |
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.