[Sugar-devel] Report about performance hackaton
godiard at sugarlabs.org
Sun Feb 23 21:40:51 EST 2014
The last Thursday and Friday, manuq and I worked together to try to find
the source of a few performance issues in Sugar.
In particular, we worked in the treeviews, for the activities list
and the Journal.
We did many, many tests, and learned a few tricks, here is a first summary.
The patches are not ready to push upstream, but we will continue working on
in the next weeks. You can look at the branches here  and 
* We did test programs to test the treeview and profile it doing:
python -m cProfile test_treeview.py > profile.txt
This was very useful. We did tests to profile the scroll and to start the
journal as a new
application in a terminal. 
* The source of the performance issues in the treeview is the
a treeview without it works ok.
* The CellRendererIcon do a lot of unneeded work, the render method can be
* The CellRendererIcon is connected to many signals, just detaching them
solves part of the problem. To do it, we implemented a ScrollingDetector
* The CellRendererIcon is not a widget, then, do not receive events when
enter or leaves, and all the logic in the CellRendererInvoker is more
should be. Worst, we had 6 different CellRendererIcons in the
Journal, then we simplified (and solved issues) implementing a
The TreeView knows where is every cell. While is much more simple and
implementation is not finished yet.
* The ObjectPalettes was created in the mouse enter callback, then if a
the mouse cursor over the activity icons., many palettes were created, and
* This changes make the activity list work really fast. The Journal no
if a user move the mouse over the activity icons, but the scroll is still
slowing at one point.
First we thought that was because of the datastore, but we found the
journal request first
30 records, and later add 10 records more, and caches the last 50. Trying
with a journal
with less than 30 records we still see a moment when the Journal scroll
but the datastore is not working. We find a suspicious method
"send_message_with_reply_and_block" doing the profiling, but we didn't
where is used of is responsible of the problem.
As you can see, this is only a start. We will prepare a wiki page with the
when is more clean, but wanted to share our findings, with the community.
Was really great work together in this issue in the same place,
I wonder if we can find a way to organize virtual hackatons by topics like
SugarLabs - Learning Software for children
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Sugar-devel