Skip to content

Commit 9511b3c

Browse files
committed
2 parents a0d7839 + 6b040f7 commit 9511b3c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ The performance of layout and drawing is almost equivalent to a single Flex or S
3434
performance of constraint calculation is roughly 0.01 milliseconds (layout of general complexity, 20
3535
child elements). Constraints are only recalculated after they have changed.
3636

37+
ConstraintLayout itself can be arbitrarily nested without performance issues, each child element in the render tree is only laid out once, and the time complexity is O(n) instead of O(2n) or worse.
38+
3739
A smaller Widget tree leads to less build time and a smaller Element tree. A very flat layout
3840
structure results in a smaller RenderObject tree and less rendering time. One thing most people tend
3941
to overlook is that complex nesting can cause build times to sometimes exceed render times.

README_CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ ConstraintLayout 不会积极支持它。
2626

2727
其中布局和绘制的性能几乎与单一 Flex 或 Stack 相当,约束计算的性能大致为 0.01 毫秒(一般复杂度的布局,20 个子元素)。只有在约束变化后才会重新计算约束。
2828

29+
约束布局自身可以被任意嵌套而不带来性能问题,渲染树中的每个子元素都只会被 layout 一次,时间复杂度为 O(n),而不是 O(2n) 或更糟糕的复杂度。
30+
2931
更小的 Widget 树带来了更少的 build 耗时和更小的 Element 树。非常扁平的布局结构带来了更小的 RenderObject 树和更少的渲染耗时。大多数人容易忽略的事情是复杂嵌套导致
3032
build 耗时有时甚至超过渲染耗时。
3133

0 commit comments

Comments
 (0)