
May 10, 2012
11:43 a.m.
Stefan Krah <stefan@bytereef.org> wrote:
Nice. This reduces the speed difference to about 4%!
Note that you don't need the actual thread id, the Python thread state is sufficient: PyThreadState_GET should be a simply variable lookup in release builds.
I've tried both ways now and the speed gain is roughly the same.
Perhaps the interpreter as a whole is slightly faster --without-threads? That would explain the remaining speed difference of 4%.
Actually this seems to be the case: In the benchmark floats are also about 3% faster without threads. Stefan Krah