3 ms·
Here is my test, with test output for gc and gccgo: https://gist.github.com/3053930 https://gist.github.com/3053930 The numbers are from Go 1.0 as that's what
by lobster_johnson 14y ago
Here is my test, with test output for gc and gccgo:
https://gist.github.com/3053930 https://gist.github.com/3053930
The numbers are from Go 1.0 as that's what is available on Ubuntu Precise, my test box. (Getting similar numbers with 1.0.2 on a different box where I don't have gccgo.)
I realized that the first loop was using "i < len(ints)" as a loop test, which turns out to be more expensive than I thought, and the compiler doesn't optimize it into a constant (which would be expecting too much, I guess). After rewriting the test, the function call case is only slightly faster, although it is still significantly faster with gccgo.