Paolo 'Blaisorblade' Giarrusso <p.giarru...@gmail.com> added the comment:
If speedup on other machines are confirmed, a slowdown of less than 2% should be acceptable (it's also similar to the statistic noise I have on my machine - it's a pity pybench does not calculate the standard deviation of the execution time). It is true that many objects are short lived, and that makes generational GC work, but the patch is about another point. Do most refcount decrements lead to garbage collection? That's a completely different question. And I don't think that popping a function call argument usually leads to a destructor invocation, for instance, unless the argument is a temporary. The same reasoning holds for most other opcodes. The simplest way to check this is to look at the compilation output with Profile-Guided Optimization active and verify which branch is optimized. Having said that, the slowdown you get (on your Athlon X2 3600+) might be due to a higher cost in case of failed static prediction, since that leads to 2 jumps. This code leads to 0 or 1 jump: if (likely(cond)) { destructor } while with unlikely, one runs through either 0 or 2 jumps. The second jump is unconditional, so it has a much smaller delay (the decode unit has to tell the fetch unit to fetch another instruction). However, in that case one has to invoke anyway the destructor through a virtual call, which is much more expensive. _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4941> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com