XO-1 Sugar startup profiling
dsd at laptop.org
Mon Mar 18 10:26:16 EDT 2013
I spent an hour comparing and investigating Sugar startup time on XO-1
for 12.1.0 vs 13.2.0 build 1.
To measure this, I modified sugar-session to add a glib idle_add call
to gtk.main_quit(), after the other bunch of idle_add calls that are
made. Then startup can be timed by stopping X and running from a root
On 12.1.0 after a couple of runs (for hot caches) this takes 22
seconds. On 13.2.0 the equivalent test takes 32 seconds.
I then re-ran the test through perf on 13.2.0 build 1.
8.66% of this time is spent in g_typelib_get_dir_entry
6.79% is spent in pure Python (EvalFrameEx)
5.8% of the time is spent in libc.
Beyond that, there are no clear "offenders". There are bucketloads of
places that just occupy around 0.02% of the startup time.
As the next steps I would suggest:
1. Investigate why g_typelib_get_dir_entry takes so long (maybe it is
just slow, or maybe it's being called far too many times?).
2. Do python-level profiling of sugar to figure out why we are also
spending a lot of time executing pure Python code.
More information about the Devel