[sugar] python performance-related issues in Sugar (was Re: Meeting minutes from yesterday)
Tomeu Vizoso
tomeu
Mon Sep 29 16:18:42 EDT 2008
On Fri, Sep 19, 2008 at 4:55 PM, Greg Dekoenigsberg <gdk at redhat.com> wrote:
>
> * Python bloat. Tomeu will send me a note regarding best practices on
> cutting bloat out of python/pygtk apps, and gdk will send around to various
> Python gurus.
Sorry to be so late.
Some performance related issues in Sugar where Python plays a role:
- Activity (and other processes) startup time: mostly due to import
time, loading tons of modules that we never actually use but that get
referenced by real dependencies. This means loading tons of data into
memory (code, comments, etc) plus executing tons of module
initialization code. Lazy loading would help here, but if I understood
correctly, it's unsafe at least in python 2.5.
- Memory usage: the same dependencies creep happen, python processes
don't share python code, resulting in lots of duplication.
We are using a python launcher hack that preloads some modules in a
python interpreter and then forks every time a process is requested.
This saves some startup time and makes python processes save a good
chunk of memory, but introduces subtle bugs all across the
dependencies because modules were initialized in an environment very
different from where they execute later.
So, the Sugar developers would like to know if any other usage of
python in the desktop has found these issues and what the conclusions
are. Could you please share your experiences?
Thanks,
Tomeu
More information about the Sugar-devel
mailing list