Profiling the interpreter from within

Courageous jkraska at san.rr.com
Thu Oct 4 23:49:11 EDT 2001


On 04 Oct 2001 20:11:06 -0400, gb at cs.unc.edu wrote:

>While thinking about where the time goes in the interpreter it occured
>to me that it should be possible to build a small extension that
>allows profiling of the interpreter and extensions from within python.

While this isn't a bad idea, the interpreter folks don't really need
to see it profiled. I profiled it in _Quantify_ a while back and
decided that there was little that could be done in terms of
obvious optimizations to the Python interpreter code. A big chunk
of time goes into various kinds of dictionary lookups; furthermore,
Python's dictionary is very, very good. While such things can
always be tweaked, one is not going to get any _noticeable_
improvement out of Python for any dictionary tweaking right now,
IMO, and that only leaves a wide variety of less appealing
optimization leads. As a general rule of thumb, if you can't
fix your number one performance hog, profiling is a waste of
valuable developer time (and that's when I quit).

It's my guess that the Python interpreter is the edge of its
performance limits without moving over to a different internal
model of how Python is processed in the interpreter.

Anyone have a few million dollars they'd like to caugh in
Python's general direction? Guido and Tim are waiting, I'm
sure. :)

C//




More information about the Python-list mailing list