CPU scaling benchmark
workers
4 +1 main
iters total
500M
100000000/stream
elapsed
1256.66 ms
total CPU used
5325.22 ms
speedup
4.24×
vs serial
efficiency
84.8%
of 5× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 6.73 | 6.74 | 1033.73 | 1026.99 | 0 |
| 1 | 1.933 | 1.95 | 18.25 | 1253.92 | 1235.67 | 220.33 |
| 2 | 1.667 | 3.64 | 23.84 | 990.37 | 966.53 | 0.1 |
| 3 | 1.505 | 5.17 | 19 | 1073.44 | 1054.44 | 39.83 |
| 4 | 1.521 | 6.71 | 37.21 | 1078.8 | 1041.59 | 45.19 |
main
w1
w2
w3
w4
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.