CPU scaling benchmark
workers
4 +1 main
iters total
500M
100000000/stream
elapsed
1274.34 ms
total CPU used
5200.67 ms
speedup
4.08×
vs serial
efficiency
81.6%
of 5× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 8.23 | 8.24 | 875.85 | 867.61 | 0 |
| 1 | 2.073 | 2.09 | 14.23 | 1029.72 | 1015.49 | 154.01 |
| 2 | 1.63 | 3.74 | 16.28 | 996.55 | 980.27 | 126.25 |
| 3 | 2.557 | 6.32 | 35.34 | 1122.96 | 1087.62 | 247.24 |
| 4 | 1.885 | 8.22 | 21.75 | 1271.43 | 1249.68 | 395.74 |
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.