[sugar] python performance

Neal Norwitz nnorwitz
Tue Mar 6 04:55:08 EST 2007


On 3/6/07, Marco Pesenti Gritti <mpg at redhat.com> wrote:
> On Mon, 2007-03-05 at 23:16 -0800, Neal Norwitz wrote:
>
> > Is any code that is known to have perf problems?  I can code review
> > for problems.
>
> Well, we have performance issues almost everywhere, both in sugar and in
> the activities. AFAIK they are not python related though. The
> bottlenecks are usually the X server and cairo.
>
> The only cases I know where python might be involved are:
>
> * Activities startup. Just "import gtk" is taking a few seconds. (Though
> the maemo people which did some research and work on it was blaming it
> on the bindings itself, which requires to link a huge number of symbols
> at startup)

One thing I noticed on my version (still Python 2.4).  sys.path
(PYTHONPATH) contained some extra directories.  This increases the
cost of imports if they hit the file system.  This isn't usually
noticeable on local file systems, but painful on NFS.  I don't know
about the XO hardware.

> * Frame animation. We have between 20% and 40% percent of CPU usage in
> python. I have not tried to profile it yet but it might very well be
> cairo.
> * Activity startup animation. We are currently redrawing the whole
> activities donut there, for every animation frame. We can optimize to
> avoid that, but still it seem really too slow. We are doing a few
> math.sin/cos there, I wonder if they are at least partially to blame.
>
> Just brainstorming. We really need to have someone spend time profiling
> to find the actual bottlenecks.

This is good to know.  While I have a lot of knowledge about the
Python core, I can easily look at these other issues.  Known issues
are the best place to start.  Best guesses help too!

More questions:
 * Do we have a wiki that keeps track of the biggest priorities or
things that need the most help?
 * Are there known ways to reproduce the problems?
 * Are these slowdowns noticeable/measurable on faster machines or
only on the actual XOs?

I have an XO laptop.  However it might be a problem to build binaries
as my desktop is an amd64?  I was able to do a complete build on
Ubuntu (although the wiki says it doesn't work).  I had to add a
dependency on libncurses-dev and I added that note to the wiki page.
I haven't tried to run/test anything yet.

n


More information about the Sugar-devel mailing list