[Pyobjc-dev] Startup time woes
Brought to you by:
ronaldoussoren
From: Just v. R. <ju...@le...> - 2003-01-17 22:02:23
|
[this started as a private conversation, I guess it makes more sense on the list now] Bill Bumgarner wrote: > Yes -- I'd like to know why it is so bloody slow, as well. > > I'm going to have to run it through the profiler sometime soon and see > what the deal is. > > Part of the problem is certainly the bridging of *all* classes. > I.e. 'from AppKit import *' has to do a lot of work to make all of > the classes available in the Python module, but I don't think that > explains *all* of the slowdown. Hm, I was also thinking it would have to be something different. I added some print statements to a simple app (the pyDotView example that was posted recently): (first run) after importing objc: 0.330672979355 after importing Foundation: 0.997979998589 after importing AppKit: 3.49985897541 after importing MyAppDelegate: 3.72730898857 (starting the event loop) initializing DotView: 11.8096979856 (second run) after importing objc: 0.102402925491 after importing Foundation: 0.417948961258 after importing AppKit: 1.14622688293 after importing MyAppDelegate: 1.30699288845 (starting the event loop) initializing DotView: 8.59571492672 Times in seconds from the top of __main__. The "initializing" line is from the DotView.initWithFrame_() method. Much time is spent between starting the event loop and setting up the window. Weird. This was with 2.2, however, with 2.3 I get a different number at the end: (first run) after importing objc: 0.306917071342 after importing Foundation: 0.843237996101 after importing AppKit: 1.79104101658 after importing MyAppDelegate: 1.98914909363 (starting the event loop) initializing DotView: 3.40978002548 (second run) after importing objc: 0.118615984917 after importing Foundation: 0.377791047096 after importing AppKit: 1.09300804138 after importing MyAppDelegate: 1.22211098671 (starting the event loop) initializing DotView: 2.63563001156 Still very slow for a trivial app, but quite a bit better. But why? Just |