Deeply nested widget trees with simple closure invocations have a high performance penalty #94585
Labels
c: performance
Relates to speed or footprint issues (see "perf:" labels)
customer: money (g3)
framework
flutter/packages/flutter repository. See also f: labels.
P2
Important issues not at the top of the work list
perf: speed
Performance issues related to (mostly rendering) speed
team-framework
Owned by Framework team
triaged-framework
Triaged by Framework team
Internal: b/292548521
Sample app:
A recorded timeline of this app on an Android Go device:
nested_builders.json.txt
This more-or-less mimics (and exaggerates) a common pattern in larger apps, where building the whole route can trigger a deeply nested widget heirarchy many of which are just
Builder
(or effectivelyBuilder
) widgets.Initial build times on these routes on an Android Go device takes several milliseconds (compared to a fraction of a millisecond with much lower values in the
_getNestedBuilders
calls, or even compared to subsequent builds where they are not all marked as dirty).I tried the following Dart program thinking it might replicate this issue, but it seems to just inline the calls:
The text was updated successfully, but these errors were encountered: