Skip to content

Improve diagram header performance

Dave Patrick requested to merge SeaDve/bustle:header-update-layouts into rustle

Requires https://gitlab.gnome.org/msandova/bustle/-/merge_requests/60.

So while working at https://gitlab.gnome.org/msandova/bustle/-/merge_requests/60 and testing scale factor changes, I wondered why it still updates the width of the layout when the text scale factor changed even though I didn't wire it up to it. After a bit of debugging, I found out that it apparently creates layouts on the fly as it is accessed (that's why), instead of caching it. This is slow since every time the MapListModel is accessed (e.g., every height update and snapshot), it creates a new layout lazily.

This PR reverts back to old ways, i.e. constructing new layouts in a Vec, but this is a lot faster than before as it only updates layouts as bus names are added or removed, instead of reconstructing the entire layouts list every time a message is added.

Edited by Dave Patrick

Merge request reports