Querying AbsoluteSize / AbsolutePosition on a Gui element that is within a layout is EXTREMELY costly

Querying AbsoluteSize / AbsolutePosition on a Gui element that is within a layout is EXTREMELY costly. It seems to recompute the layout every time you request these values. We primarily use this for culling of Gui elements. It would be extremely useful to A: know whether or not a Gui element is actually visible on the screen. B: Not have querying these values be so expensive by using a cached size for that frame. We have tried creating our own caching systems but it does not work properly (it requires a LOT of edge cases). It should only update these values when a child element has been resized or the screen size itself effected the layout - not just EVERY time you query these values.

Expected behavior

Querying AbsoluteSize / AbsolutePosition should be instant and not recompute the entire UI needlessly.
Additionally, we should have a VERY fast way to detect if a Gui element is visible on the screen.

7 Likes

Thanks for the report! We’ll follow up when we have an update for you!

2 Likes

Bump, absolute size and position both feel extremely commonly used and efficient querying seems like a feature worth prioritizing. My current use-case is a minimap in my game, updated on heartbeat. Would like to avoid unnecessary custom caching implementations as well if there is a cleaner implementation on the engine side.

1 Like

Bumping - any updates on this?

2 Likes