CPU scaling benchmark
workers
4 +1 main
iters total
500M
100000000/stream
elapsed
1255.1 ms
total CPU used
5309 ms
speedup
4.23×
vs serial
efficiency
84.6%
of 5× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 6.19 | 6.2 | 1254.83 | 1248.63 | 0 |
| 1 | 1.765 | 1.78 | 17.29 | 1020.3 | 1003.01 | 0.09 |
| 2 | 1.469 | 3.27 | 16.6 | 969.95 | 953.35 | 0.18 |
| 3 | 1.473 | 4.76 | 18.52 | 995.7 | 977.18 | 0.2 |
| 4 | 1.415 | 6.19 | 36.03 | 1162.86 | 1126.83 | 0.22 |
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.