Container getLocalBounds performance issues #1476
Closed
BioRyajenka
started this conversation in
General
Replies: 2 comments 3 replies
-
Im fine with propagating up the dirtyness of children tranforms. I believe that works already on UIView? At least there is a relayout somewhere. We might want to generalize it. Do you want to implement it yourself? Or your PR wont be related ro that? |
Beta Was this translation helpful? Give feedback.
3 replies
-
Fixed here: #1487 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Container.getLocalBoundsInternal()
is heavy because it needs to iterate all children. It becomes bottleneck when you useView.width
/View.height
properties too often, and you usually want to use them often. So for each width/height it calculates bounds from scratch.My particular problem is with UIScrollable. During update phase
getLocalBoundsOptimized()
is being called 4 times (indirectly), which gives poor performance. I will create PR to fix that for UIScrollable soon, but here I wanted to discuss ways to fix the source issue.E.g. the most efficient way will be to cache the bounds and only recalculate them when necessary. E.g. by adding
dirty
flag. But it won't work because you can't track all your children position/size changes automatically.What is your thoughts? Does it worth efforts at all, or we have to live with it, always keeping in mind width/height props are slow?
Beta Was this translation helpful? Give feedback.
All reactions