CPU scaling benchmark
workers
3 +1 main
iters total
500M
125000000/stream
elapsed
1129.89 ms
total CPU used
4385.26 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 | 5.14 | 5.15 | 1093.88 | 1088.73 | 0 |
| 1 | 1.97 | 1.98 | 17.76 | 1114.99 | 1097.23 | 21.24 |
| 2 | 1.482 | 3.49 | 16.54 | 1106.86 | 1090.32 | 13.15 |
| 3 | 1.597 | 5.11 | 18.12 | 1127.1 | 1108.98 | 33.34 |
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.