CPU scaling benchmark
workers
3 +1 main
iters total
500M
125000000/stream
elapsed
1117.69 ms
total CPU used
4353.07 ms
speedup
3.89×
vs serial
efficiency
97.3%
of 4× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 4.82 | 4.83 | 1082.87 | 1078.04 | 0 |
| 1 | 1.916 | 1.93 | 18.7 | 1108.61 | 1089.91 | 25.91 |
| 2 | 1.44 | 3.39 | 18.66 | 1114.19 | 1095.53 | 31.42 |
| 3 | 1.394 | 4.8 | 19.74 | 1109.33 | 1089.59 | 34.76 |
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.