[Dev] Profile of startup
Nicholas Bastin
nbastin at mac.com
Mon Apr 5 16:00:53 PDT 2004
On Apr 5, 2004, at 6:18 PM, John Anderson wrote:
> While fixing a bug, I was doing some hotshot profiling and thought it
> would be interesting to profile release Chandler startup, when a
> repository already exists, to see if there was anything interesting
> that might explain our slow startup time. Surpriseingly, I discovered
> that the routine that we spent the most time in was warn (warnings.py)
> and that the vast majority of other routines in the profile listing
> were repository related. Here's the output for those of you who are
> interested.
>
> John
>
>
> 631694 function calls (618330 primitive calls) in 40415.812
> CPU seconds
Seriously, does your chandler startup really take 11 hours, and if so,
when did you cross-compile to C64? :-) I don't think that I need to
go on a rant on how inaccurate the HotShot stats really are. HOWEVER,
in general I've found that the hotshot times are useful in a relative
sense, so in that respect, you still have a problem. It seems to me
that 11000 calls to warn() is a bit excessive, plus warnings.py was a
source of some discussion at PyCon for optimization, so doing something
about that would certainly help the startup case. Do you really need
warnings, or can you get by with something simpler? Also, I've been
looking at rewriting warnings as a builtin to avoid pulling in
linecache and re (and related sre madness), but maybe you guys will
want to take that torch and run with it since I really don't have the
time right now...
--
Nick
More information about the Dev
mailing list