File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ The performance of layout and drawing is almost equivalent to a single Flex or S
34
34
performance of constraint calculation is roughly 0.01 milliseconds (layout of general complexity, 20
35
35
child elements). Constraints are only recalculated after they have changed.
36
36
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
+
37
41
It is recommended to use ConstraintLayout at the top level. For extremely complex layout(one
38
42
thousand child elements, two thousand constraints), layout and drawing total time within 5
39
43
milliseconds(debug mode on Windows 10,release mode take less time), the frame rate can be easily
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ ConstraintLayout 不会积极支持它。
26
26
27
27
其中布局和绘制的性能几乎与单一 Flex 或 Stack 相当,约束计算的性能大致为 0.01 毫秒(一般复杂度的布局,20 个子元素)。只有在约束变化后才会重新计算约束。
28
28
29
+ 更小的 Widget 树带来了更少的 build 耗时和更小的 Element 树。非常扁平的布局结构带来了更小的 RenderObject 树和更少的渲染耗时。大多数人容易忽略的事情是复杂嵌套导致
30
+ build 耗时有时甚至超过渲染耗时。
31
+
29
32
推荐在顶层使用 ConstraintLayout。对于极端复杂的布局(1000 个子元素,2000 个约束),非首帧布局和绘制的总耗时在 5 毫秒内(在 Windows 10
30
33
调试模式下,发布模式耗时更少),理论上首帧优势会更明显。对于常规复杂布局(50 个子元素,100 个约束),帧率可轻松达到 200 fps。
31
34
You can’t perform that action at this time.
0 commit comments