CPU scaling benchmark
workers
4 +1 main
iters total
500M
100000000/stream
elapsed
1134.77 ms
total CPU used
5352.89 ms
speedup
4.72×
vs serial
efficiency
94.4%
of 5× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 7.48 | 7.5 | 1091.9 | 1084.4 | 0 |
| 1 | 2.073 | 2.09 | 17.64 | 1089.6 | 1071.96 | 0.11 |
| 2 | 1.552 | 3.67 | 19.79 | 1015.89 | 996.1 | 3.2 |
| 3 | 1.623 | 5.31 | 20.58 | 1127.02 | 1106.44 | 35.25 |
| 4 | 2.133 | 7.47 | 38.02 | 1132.01 | 1093.99 | 40.23 |
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.