[sugar] python performance

Marco Pesenti Gritti mpg at redhat.com
Tue Mar 6 05:39:22 EST 2007


On Tue, 2007-03-06 at 01:55 -0800, Neal Norwitz wrote:
> 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.

Right. We are uncertain how much that affects performance on the XO in
real... We need to measure.

> 
> > * 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!
> 

Awesome!

> More questions:
>  * Do we have a wiki that keeps track of the biggest priorities or
> things that need the most help?

We don't, but it would be useful to have one. I think the biggest
priority are in order:

* Browser perfomance especially page scrolling (not related to python at
all but...)
* Activities startup time.
* Frame animation performance.
* Activities startup animation performance (it is run at a very very low
fps right now to not create problem, but it should really be increased).

>  * Are there known ways to reproduce the problems?

Yeah, if you want to attack any of these, I can help you out reproduce.
And we should put the info on the wiki then.

>  * Are these slowdowns noticeable/measurable on faster machines or
> only on the actual XOs?
> 

Only on the 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.

We are usually using the images to do testing on the XO. We can get
patches in for testing, once we have a good hope they will actually help
out.

Just testing random stuff out is quite painful atm though, for compiled
code. I usually build on my box and then copy over the changed
bin/library. I think we really need an image with development tools on
it.

Marco



More information about the Sugar mailing list