Glade is extremely slow with large GtkGrid

I am working on a user interface for a project using Glade in which I create a GtkGrid with dimension 22 rows by 36 columns. While no children widgets are added to the grid, Glade behaves normally in the sense that it closes quickly when I exit Glade. But as I add labels and/or buttons, closing Glade becomes slower and slower. If I fill all the placeholder locations with child widgets it will actually take hours to close Glade (but it does close).

Glade remains totally responsive as I edit the file.

The speed with which Glade saves the file also seems unaffected, as I can see using vi that the file is updated immediately.

When running my project application it behaves almost normally except for a slight delay in command line responsiveness after I exit my application. So the application is perfectly usable. I have a very fast computer but it might be problematic with a slower one. I haven’t tried.

I have created a simple example Glade file to demonstrate the issue:

https://pdbuchan.com/tmp/example.ui

The example above causes Glade to take about 10 seconds to close for me. If you add more child widgets it will slow down even more.

It almost seems like there is some process in Glade that operates on order n^2. i.e., O(n^2)

My questions are: Is this an inappropriate use of GtkGrid? Is there a more appropriate way of achieving a large array of buttons? Does this illustrate an inefficiency in the way Glade handles large grids?

I’m using GTK+3 and Glade 3.38.2 with Glade targeting GTK 3.24 webkit2gtk 2.28 on Ubuntu Linux 22.04.3 LTS with Intel i9-12900K with 64 GB of memory.

Leave a Comment