Skip to content

iconGrid: Allocate using allocate_preferred_size() instead of using box

This commit was split out from !1713 (merged), see !1713 (comment 1048631) for the discussion about it.


Handling a ClutterActorBox from JS means invoking lots of JS<->C trampolines, and that is slow. We can easily avoid the whole box by using clutter_actor_allocate_preferred_size() instead.

Note that this slightly changes the behavior: We now no longer enforce a minimum size, but will allocate items a smaller size than the childSize. Given that all children of our grid have a fixed icon size though, they report a fixed size anyway, so that shouldn't be a problem.

This saves quite a lot of resources, in measurements of the average duration spent in iconGrids vfunc_allocate, the time went down from 0.7 ms to 0.4 ms.

Merge request reports