Skip to content

Commit 0baac5c

Browse files
committed
update readme
1 parent 63ffe96 commit 0baac5c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ 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+
A smaller Widget tree leads to less build time and a smaller Element tree. A very flat layout
38+
structure results in a smaller RenderObject tree and less rendering time. One thing most people tend
39+
to overlook is that complex nesting can cause build times to sometimes exceed render times.
40+
3741
It is recommended to use ConstraintLayout at the top level. For extremely complex layout(one
3842
thousand child elements, two thousand constraints), layout and drawing total time within 5
3943
milliseconds(debug mode on Windows 10,release mode take less time), the frame rate can be easily

README_CN.md

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

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

29+
更小的 Widget 树带来了更少的 build 耗时和更小的 Element 树。非常扁平的布局结构带来了更小的 RenderObject 树和更少的渲染耗时。大多数人容易忽略的事情是复杂嵌套导致
30+
build 耗时有时甚至超过渲染耗时。
31+
2932
推荐在顶层使用 ConstraintLayout。对于极端复杂的布局(1000 个子元素,2000 个约束),非首帧布局和绘制的总耗时在 5 毫秒内(在 Windows 10
3033
调试模式下,发布模式耗时更少),理论上首帧优势会更明显。对于常规复杂布局(50 个子元素,100 个约束),帧率可轻松达到 200 fps。
3134

0 commit comments

Comments
 (0)