CPU scaling benchmark
workers
3 +1 main
iters total
500M
125000000/stream
elapsed
1120.46 ms
total CPU used
4351.32 ms
speedup
3.88×
vs serial
efficiency
97%
of 4× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 8.18 | 8.19 | 1089.37 | 1081.18 | 0 |
| 1 | 4.939 | 4.95 | 23.81 | 1118.21 | 1094.4 | 28.97 |
| 2 | 1.671 | 6.63 | 23.82 | 1112.58 | 1088.76 | 27.34 |
| 3 | 1.52 | 8.17 | 24.67 | 1111.65 | 1086.98 | 22.46 |
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.