Report on `views with many icons' profiling

riccardo riccardo.lucchese at
Thu Jul 17 13:43:34 EDT 2008


Problem: slow switching between views with many icons

Test-case: the test consist of switching between the favorites view and
the list view. Test were ran once with the ring layout in the favorite
view and once with the freeform layout; the xo had 25 activities
installed all checked as `favorite'. The action of switching was
automated with a timer with period 130ms when the ring layout was
selected and 170ms in the case of the freeform layout (as the minimum
values permitting complete redraw of the views).

Note that there is a noticeable delay when switching to the favorites
views when the selected layout is freeform.

--- RING layout ---
The following tab. and fig. show cpu time usage of the processes
taking more cpu time while running the test:

(tot% us+sy) - (partial% us+sy) : cmdline
             - 63.6             : python /usr/bin/sugar-shell
 91.2        - 27.5             : /usr/bin/X :0 -fp built-ins...
 99.5        - 8.2              : picker -t30
( )

They were obtained by running:
$ picker -t30
$ grapher -c3

--- FREEFORM layout ---
(tot% us+sy) - (partial% us+sy) : cmdline
             - 82.              : python /usr/bin/sugar-shell
 91.6        - 9.5              : /usr/bin/X :0 -fp built-ins...
 99.4        - 7.7              : picker -t30
( )

 ! sugar-shell is taking 20% more cpu time than in the ring layout case.

cProfile statistics (KCacheGrind format) for sugar-shell:
--- RING layout ---

Ordering by function's self-time:
  %      func name
35.6   : cairo.Context.paint
3.9    : gtk.Container.add
2.     :
1.9    : __setitem__ sugar.util

Well, this isn't unexpected. But it's interesting when looking at
sysprof results (below).

--- FREEFORM layout ---

Ordering by function's self-time:
  %      func name
21.6   : _add_weight in sugar/shell/view/home/
21.5   : _remove_weight in sugar/shell/view/home/
10.6   : cairo.Context.paint
8.1    : __setitem__ sugar.util
5.7    : _compute_weight in sugar/shell/view/home/

 ! Box2D would perform better ;)

Sysprof results. Well, in sysprof there are many nested levels, so it is
much more clear to just look at it.

--- RING layout ---

- most of self-time is spent in the kernel and in X/X-modules.

- time spent in the kernel is due to python and X, respectively 60%-40%.

- time spent `in X' goes mostly to the geode driver, and then, to Xorg
itself and the libexa module.

--- FREEFORM layout ---

Notes for the ring layout are valid also here. 

There are two (new) entries in this case and they are taking more time
than the X geode module: python's numpy/core/ and
numpy/core/ This is in relation with the algorithm used in the
freeform layout to avoid icons collisions.


More information about the Devel mailing list