3 ms·
Can anyone explain why BenchmarkUnroll was specifically set to run twice as many iterations as the other two for the timing tests? It seems intentional. But w
by thebigshane 15y ago
Can anyone explain why BenchmarkUnroll was specifically set to run twice as many iterations as the other two for the timing tests? It seems intentional. But why? Is there some overhead in having the compiler unroll the code versus manually that required more iterations to "even out"?
BenchmarkUpdate 500000 2996 ns/op
BenchmarkManual 500000 4642 ns/op
BenchmarkUnroll 1000000 2824 ns/op