[wxpython-users] slow startup of wxPython application
Jürgen Kareta
python at kareta.de
Wed Apr 16 15:09:09 PDT 2008
C M schrieb:
> I have a small unfinished application that seems to have an
> unexpectedly slow time to start up (by clicking on the Python icon for
> the main frame of the application) given how small it is. From a cold
> start of not having been run recently, it takes ~37 seconds for the
> app to load from the time of clicking to when it is displayed. Then,
> after it is closed and reopened, it pops up very quickly, a few
> seconds.
>
> This seems really slow to me for such a dinky application, and I've
> seen this with many small apps I've made. This application is a frame
> (~700 lines) which imports a frame (~500 lines) and a framepanel (~300
> lines). It is running with the following specs:
>
> - wxPython 2.8.7.1
> - Python 2.5
> - Windows XP, SP2
> - Gateway Tablet PC, 1.7 Ghz, 512 Meg RAM
> - and it import a fair number of modules,
> including bigger things like matplotlib and sqlite
>
> I realize that in running the application I am also having to run the
> Python interpreter. But are there ways to try to reduce the start up
> time of the application or any wxPython application? Some of the
> intended apps are to be run at start-up of the computer, and so it is
> less important, but generally I'd still like to know ways to reduce
> this time if possible.
>
> Thanks,
> CM
> _______________________________________________
> wxpython-users mailing list
> wxpython-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>
>
>
same to me using wxpython & matplotlib:
cold: 24 sec, profiling 4.621 CPU seconds
after: 5 sec, profiling 3.344 CPU seconds
using
if __name__ == '__main__':
import cProfile
cProfile.run('main()')
to start the application
- wxPython 2.8.7.1
- Python 2.5
- Windows XP, SP2 on PentiumIV, 2.2 GH, 1 GB Ram
Unless I missed something important I don't see how profiling could help to track it down. I guess the main part of the time is used to load the libraries into memory which are still hold there after the first run.
I don't like it, but can live with it as the application itself runs smoothly.
Jürgen
More information about the wxpython-users
mailing list