Hi,
due to the change to 64 bit ints in tip, I noticed that 64 bit integer
division is almost three times slower than 32 bit integer division, on an
amd64 system[1].
I created a small collection of benchmarks and disassemblies[2] that
demonstrate the behaviour.
To be honest I lack the deeper understanding to say if this difference
in performance is to be expected or something that can be fixed, which
is why I am asking you to take a look at it.
In the case that this is actually expected, how should we deal with it
in future versions of Go, where int implies int64 on 64 bit systems?
Using int32 explicitly will definitely lead to less nice code because of
a lot of required conversions.
Thanks,
Dominik
[1]: Linux dominikh-pc 3.2.1-gentoo-r2 #7 SMP Mon May 7 16:40:12 CEST
2012 x86_64 Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz GenuineIntel
GNU/Linux
[2]: http://play.golang.org/p/4CbUZSj2lr
--