[maemo-developers] python startup time

From: Jesse Guardiani jesse at guardiani.us
Date: Fri Nov 16 17:30:13 EET 2007
See this from the OLPC project:
http://blogs.gnome.org/johan/2007/01/18/introducing-python-launcher/

python-launcher is a daemon that caches GTK imports. kinda like mod_python
for GTK. Maybe we should add this to maemo and give it a control panel
applet or something?

It would make GTK Python apps usable from a startup time perspective.

On 11/10/07, Martin Grimme <martin.grimme at gmail.com> wrote:
>
> Hi,
>
> if you are importing lots of modules, you can get the startup time down by
> not importing the modules at the top of a file, but at the place where you
> need it in a function.
> Note that modules are loaded only once, so subsequent import commands will
> have no effect.
>
> Example:
> instead of this:
>
>   import os
>
>   def foo():
>       print os.listdir()
>
>
> you can write this:
>
>   def foo():
>     import os
>     print os.listdir()
>
>
> Cheers,
> Martin
>
>
> 2007/11/9, Jesse Guardiani <jesse at guardiani.us>:
> >
> > Hello,
> >
> > Is there anything that can be done about python startup time?
> > I recently wrote a very simple little pygtk + glade application that is
> > less than 110 lines of code and it takes between 5 and 9 seconds to start
> > up.
> >     http://www.guardiani.us/projects/tip_calc/browser/trunk/src/tip_calc/tip_calc.py
> >
> > Any way to get that startup time down?
> >
> >
> > --
> > Jesse Guardiani
> > Software Developer / Sys Admin
> > jesse at guardiani.us
> > _______________________________________________
> > maemo-developers mailing list
> > maemo-developers at maemo.org
> > https://lists.maemo.org/mailman/listinfo/maemo-developers
> >
> >
>
> _______________________________________________
> maemo-developers mailing list
> maemo-developers at maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers
>
>


-- 
Jesse Guardiani
Software Developer / Sys Admin
jesse at guardiani.us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maemo.org/pipermail/maemo-developers/attachments/20071116/29b71f81/attachment.htm 
More information about the maemo-developers mailing list