CPU scaling benchmark
workers
3 +1 main
iters total
500M
125000000/stream
elapsed
1114.86 ms
total CPU used
4353.47 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 | 4.84 | 4.85 | 1083.07 | 1078.22 | 0 |
| 1 | 1.766 | 1.78 | 15.5 | 1102.74 | 1087.24 | 19.87 |
| 2 | 1.528 | 3.34 | 16.5 | 1109.74 | 1093.24 | 26.81 |
| 3 | 1.476 | 4.83 | 17.55 | 1112.32 | 1094.77 | 29.39 |
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.