Comment 1 for bug 1356691

Revision history for this message
Jim Nelson (yorba-jim) wrote :

Right now, Gtk.FlowBox requires widgets for all items be inserted into the view. For a basic display of an image with title beneath it with a bounding box, that's three widgets per photo. If a library has 10,000 photos, that's 30,000 widgets and 10,000 pixbufs in memory.

Resize performance is also a concern. If GtkFlowBox has to visit each child widget for a resize request, performance is going to be an issue with large libraries.

With a scrolling model-controller, widgets would be instantiated and destroyed as the scroll into and out of view. Presumably somewhere in the mix would be a way for the model-controller to specify the size of the uninstantiated widgets (or, better yet, a fixed size for all widgets). I know there's discussion among the GTK folks about implementing something like this for GtkFlowBox and GtkListBox.

Shotwell's CheckerboardLayout uses a custom model-controller for these reasons, although it doesn't use widgets for each photo, instead they paint directly to the Cairo canvas. Thumbnail pixbufs are demand-loaded as the viewport moves so there's never too many in memory at once time. Each photo and its text labels are fixed size, so calculating the flow doesn't require iteration of the children.