CPU scaling benchmark
workers
3 +1 main
iters total
500M
125000000/stream
elapsed
1112.43 ms
total CPU used
4349.81 ms
speedup
3.91×
vs serial
efficiency
97.8%
of 4× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 5.66 | 5.67 | 1084.97 | 1079.3 | 0 |
| 1 | 1.667 | 1.68 | 14.51 | 1102.89 | 1088.38 | 18.09 |
| 2 | 2.421 | 4.13 | 16.03 | 1110.35 | 1094.32 | 25.48 |
| 3 | 1.502 | 5.65 | 17.01 | 1104.82 | 1087.81 | 23.35 |
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.