CPU scaling benchmark
workers
4 +1 main
iters total
500M
100000000/stream
elapsed
1165.69 ms
total CPU used
5333.14 ms
speedup
4.58×
vs serial
efficiency
91.6%
of 5× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 7.91 | 7.91 | 1074.33 | 1066.42 | 0 |
| 1 | 1.922 | 1.94 | 15.8 | 993.45 | 977.65 | 0.11 |
| 2 | 1.493 | 3.45 | 21.49 | 1162.99 | 1141.5 | 88.78 |
| 3 | 1.414 | 4.88 | 18.68 | 1110.92 | 1092.24 | 36.73 |
| 4 | 2.997 | 7.9 | 21.5 | 1076.83 | 1055.33 | 2.67 |
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.