CPU scaling benchmark
workers
3 +1 main
iters total
500M
125000000/stream
elapsed
1115.46 ms
total CPU used
4350.88 ms
speedup
3.9×
vs serial
efficiency
97.5%
of 4× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 5.68 | 5.68 | 1085.23 | 1079.55 | 0 |
| 1 | 2.255 | 2.27 | 16.52 | 1111.11 | 1094.59 | 25.98 |
| 2 | 1.696 | 3.99 | 17.19 | 1106.42 | 1089.23 | 21.35 |
| 3 | 1.652 | 5.66 | 19.78 | 1107.29 | 1087.51 | 25.23 |
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.