CPU scaling benchmark

workers
3 +1 main
iters total
500M
125000000/stream
elapsed
1140.9 ms
total CPU used
4383.09 ms
speedup
3.84×
vs serial
efficiency
96%
of 4× ideal
stream spawn ms spawned@ work start@ work end@ work ms reap wait ms
0 (main) 0 4.77 4.78 1086.15 1081.37 0
1 1.819 1.83 16.01 1104.23 1088.22 18.24
2 1.389 3.24 16.25 1138.04 1121.79 52.02
3 1.504 4.76 19.89 1111.6 1091.71 25.58
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.