One of the big issues we had in with the Activity Journal was startup time and navigation time. After Michal Hruby kept nagging us on fixing the issue (we used him as the benchmarking measurement and performance profiling), Siegfried and I started working on these issues.
First Siegfried managed to fix the startup time by creating an extension for Zeitgeist that populates the histogram in the bottom. Querying events for 90 in days in one query per day makes itself noticeable, so his approach of a dedicated API from zeitgeist was the best solution. However it did not improve the navigation time.
After 2 days of work motivated by the romantic dinner Michal wants to buy me to fix the issue, we reached our goal. Here is what I did to improve the navigation:
- Apply singleton pattern on GIO Files on each URI to reduce initializing a new ones for each event.
- Lazy loading of UI elements. So if the category is not collapsed we don't draw the elements.
- Redraw only days that changed.
- Unparent reuse gtk widgets when navigating.
The new Activity Journal is at least 7.3 times faster than what we released last week. Funny enough even the memory consumption is less, due to the singeltons and lazy loading.