GSoC 2020: the first milestone

Vineet
3 min readJul 1, 2020

Please read the previous post for context!

It has been one complete month since the coding period of Google Summer of Code started. In this period, I have learnt a huge number of things, and have made visible progress towards the goal of my project.

The aim of my project was to remove the speed issues present in the TreeView of the files plugin in gitg. The plan was to make a custom TreeModel that would lazily load up nodes, and preserve expanded nodes when the model changes (i.e jumping from commit to commit)

During the community bonding period, I had a video call with my absolutely amazing mentor Alberto, who told me about GNOME culture, and about his inspiring journey with GNOME as contributor. In the last month, I have been welcomed by the community and am very proud to be contributing to GNOME.

Here’s a summary of the technical work that has been done in the last month.

Setting up the test-bed

In order to test the various algorithms and implementations we had in mind, Alberto recommended we start a small separate project that would only contain the necessary code from gitg, so that we could directly work on the core issues and not get bogged down in unnecessary details.

I spent the first week of June building a test bed project in Vala, with Meson as the build system. Here it is.

Trees are represented in JSON for convenience’s sake.

Along with the main application, I’ve added scripts that generate large trees for testing purposes. It loads trees in JSON format, and two TextViews which take source tree and destination trees.

Making progress: with libdazzle

After a week of researching various ideas for the optimisation, I stumbled upon libdazzle. libdazzleis a collection of widgets and features that are very useful, but out of Gtk and GObject’s scope. I discovered that there is a lazy loaded TreeView subclass in libdazzle called Dazzle.Tree. Of course, it did not have the tree switching algorithm that we desired, but I could still use it a very solid foundation for our usage.

Unfortunately, libdazzle is under-documented, and I could not find any examples for Dazzle.Tree, which uses a separate data loading mechanism than normal TreeViews. After a week of digging around the source code and finding examples in the GNOME Builder codebase, and good help from hergertme on #gnome-builder, I was finally able to make it work.

After that, I applied a simple algorithm that retained previously expanded nodes and we have the implementation available in this merge request to the test-bed project. Currently, it works perfectly and is fast enough for our uses in gitg. I am still testing everything out to make sure it works well.

Looking forward

It has been an amazing month of learning with the GNOME community, and I’ve learnt a lot about how Vala works, how to read and understand C code, Meson build systems, and many more things that I cannot list in a single blog post.

In the next month, I aim to integrate the lazy tree view directly into gitg, and start writing tests for the same functionality. Dazzle.Tree has quite a few features that can be useful for gitg, such as the MIME based icons, and I plan to eventually start integrating those as well.

I would like to thank the GNOME community for welcoming me, and Alberto for being an amazing mentor.

See ya next month, hopefully we’ll have even more good news by then! 😄

--

--

Vineet

Interning at a VC fund, dreaming of Jung’s writings, and probably in the front row of a rave.