CPU scaling benchmark
workers
4 +1 main
iters total
500M
100000000/stream
elapsed
1146.31 ms
total CPU used
5341.99 ms
speedup
4.66×
vs serial
efficiency
93.2%
of 5× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 6.54 | 6.56 | 1086.18 | 1079.62 | 0 |
| 1 | 1.875 | 1.89 | 16.96 | 1055.99 | 1039.03 | 0.1 |
| 2 | 1.464 | 3.39 | 26.08 | 1142.94 | 1116.86 | 59.43 |
| 3 | 1.551 | 4.95 | 20.17 | 1022.16 | 1001.99 | 0.16 |
| 4 | 1.556 | 6.53 | 38.02 | 1142.51 | 1104.49 | 56.46 |
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.