[Dev] Profile of startup.

Nicholas Bastin nbastin at mac.com
Mon Apr 5 23:13:42 PDT 2004


On Apr 5, 2004, at 7:48 PM, Mike Taylor wrote:

> I am running profile tests of the core repository items - do you want 
> me to add startup to the list and start publishing the results?

Ted asked me to post a followup to my earlier message, with some notes 
about accurate profiling, so here's some info.

First, for the most accurate call times, you should use the standard 
python profiler (profile).  It's slow, but the times are generally 
good.  If you need a really fast profiler, use hotshot, but you should 
be aware of the timing issue - on some platforms (at least x86 linux), 
the call times are totally bogus.  However, they have proven to be 
accurate relative to each other, and to other runs done on the same 
platform, so if you're only comparing numbers from one run to the next, 
using hotshot is fine.  If you need to publish results, however, you 
should use profile, since the hotshot numbers aren't necessarily 
comparable across platforms.

As an aside, if you want to profile the number of calls to builtins and 
C extension functions, you can pull the latest python 2.4 CVS which 
includes my patch to support new event types for c calls (and includes 
an updated profile.py to support it - _hotshot.c has not been updated).

--
Nick



More information about the Dev mailing list