CPU scaling benchmark
workers
4 +1 main
iters total
500M
100000000/stream
elapsed
1202.68 ms
total CPU used
5473.15 ms
speedup
4.55×
vs serial
efficiency
91%
of 5× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 9.74 | 9.75 | 1145.55 | 1135.8 | 0 |
| 1 | 1.978 | 2 | 14.76 | 1145.25 | 1130.49 | 0.1 |
| 2 | 1.706 | 3.73 | 17.05 | 1025.56 | 1008.51 | 2.75 |
| 3 | 1.56 | 5.32 | 19.29 | 1046.23 | 1026.94 | 2.77 |
| 4 | 4.403 | 9.74 | 28.33 | 1199.74 | 1171.41 | 54.36 |
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.