debugProfilePaintsEnabled top-level property
Adds Timeline events for every RenderObject painted.
The timing information this flag exposes is not representative of actual paints, because the overhead of adding timeline events is significant relative to the time each object takes to paint. However, it can expose unexpected painting in the timeline.
In debug builds, additional information is included in the trace (such as the properties of render objects being painted). Collecting this data is expensive and further makes these traces non-representative of actual performance. This data is omitted in profile builds.
For more information about performance debugging in Flutter, see docs.flutter.dev/perf/ui-performance.
See also:
- debugProfileBuildsEnabled, which does something similar for widgets being rebuilt, and debugPrintRebuildDirtyWidgets, its console equivalent.
- debugProfileLayoutsEnabled, which does something similar for layout, and debugPrintLayouts, its console equivalent.
- The discussion at RendererBinding.drawFrame.
- RepaintBoundary, which can be used to contain repaints when unchanged areas are being excessively repainted.
- debugEnhancePaintTimelineArguments, which enhances the trace with debugging information related to RenderObject paints.
Implementation
bool debugProfilePaintsEnabled = false;