CPU scaling benchmark

workers
4 +1 main
iters total
500M
100000000/stream
elapsed
1235.39 ms
total CPU used
5336.23 ms
speedup
4.32×
vs serial
efficiency
86.4%
of 5× ideal
stream spawn ms spawned@ work start@ work end@ work ms reap wait ms
0 (main) 0 7.29 7.3 1160.7 1153.4 0
1 2.006 2.02 16.26 959.32 943.06 0.1
2 1.52 3.56 16.57 1086.28 1069.71 0.17
3 1.475 5.06 20.99 1232.58 1211.59 72.03
4 2.206 7.28 46.82 1005.29 958.47 0.18
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.