CPU scaling benchmark
workers
3 +1 main
iters total
500M
125000000/stream
elapsed
1111.25 ms
total CPU used
4353.32 ms
speedup
3.92×
vs serial
efficiency
98%
of 4× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 6.36 | 6.37 | 1092.2 | 1085.83 | 0 |
| 1 | 2.125 | 2.14 | 14.18 | 1108.38 | 1094.2 | 17.36 |
| 2 | 1.575 | 3.73 | 15.77 | 1104.27 | 1088.5 | 13.51 |
| 3 | 2.602 | 6.35 | 16.83 | 1101.62 | 1084.79 | 9.55 |
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.