CPU scaling benchmark

workers
4 +1 main
iters total
500M
100000000/stream
elapsed
1188.59 ms
total CPU used
5374.99 ms
speedup
4.52×
vs serial
efficiency
90.4%
of 5× ideal
stream spawn ms spawned@ work start@ work end@ work ms reap wait ms
0 (main) 0 7.97 7.98 1062.29 1054.31 0
1 1.975 1.99 14.1 1041.75 1027.65 0.09
2 1.52 3.53 15.86 1099.04 1083.18 36.92
3 2.68 6.23 21.43 1185.89 1164.46 123.73
4 1.728 7.97 49.89 1095.28 1045.39 33.09
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.