CPU scaling benchmark
workers
2 +1 main
iters total
500M
166666666/stream
elapsed
1478.66 ms
total CPU used
4361.66 ms
speedup
2.95×
vs serial
efficiency
98.3%
of 3× ideal
| stream | spawn ms | spawned@ | work start@ | work end@ | work ms | reap wait ms |
|---|---|---|---|---|---|---|
| 0 (main) | 0 | 3.21 | 3.22 | 1446.42 | 1443.2 | 0 |
| 1 | 1.801 | 1.82 | 15.55 | 1475.32 | 1459.77 | 32.18 |
| 2 | 1.356 | 3.2 | 16.52 | 1475.21 | 1458.69 | 28.97 |
main
w1
w2
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.