CPU scaling benchmark
workers
4 +1 main
iters total
500M
100000000/stream
elapsed
1209.51 ms
total CPU used
5373.21 ms
speedup
4.44×
vs serial
efficiency
88.8%
of 5× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 6.45 | 6.46 | 1037.7 | 1031.24 | 0 |
| 1 | 1.838 | 1.85 | 16.16 | 1106.01 | 1089.85 | 68.44 |
| 2 | 1.471 | 3.34 | 45.19 | 1206.71 | 1161.52 | 169.15 |
| 3 | 1.58 | 4.94 | 20.31 | 990.74 | 970.43 | 0.08 |
| 4 | 1.487 | 6.43 | 42.39 | 1162.56 | 1120.17 | 125.03 |
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.