pointless musings on performance
solipsis at pitrou.net
Wed Nov 25 13:11:31 CET 2009
Le Tue, 24 Nov 2009 16:09:10 -0800, Paul Boddie a écrit :
> I'm referring to what you're talking about at the end. The enhancements
> in Python 3 presumably came about after discussion of "threaded
> interpreters", confirming that the evaluation loop in Python 2 was not
> exactly optimal.
An optimal evaluation loop is a evaluation loop which doesn't get
executed at all :-)
(which is what unladen-swallow, cython and pypy are trying to do)
> You need to draw the line between work done by system and external
> libraries and that done by Python, but a breakdown of the time spent
> executing each kind of bytecode instruction could be interesting.
When you say "executing each kind of bytecode instruction", are you
talking about the overhead of bytecode dispatch and operand gathering, or
the total cost including doing the useful work?
Regardless, it probably isn't easy to do such measurements. I once tried
using AMD's CodeAnalyst (I have an AMD CPU) but I didn't manage to get
any useful data out of it; the software felt very clumsy and it wasn't
obvious how to make it take into account the source code of the Python
More information about the Python-list