flutter / flutter/devtools

[FR] Make it easier to identify performance bottlenecks in app

未关闭
#9,606 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
cost: high new feature P3 screen: performance
主要语言
Dart
星标
1.7k
派生
404
平均合并
6 天 17 小时
30 天内合并 PR
18

描述

### Description

A user is requesting a way to easily find the widget/s responsible for performance issues in their app.

The Performance Panel currently supports tracking widget [builds](https://docs.flutter.dev/tools/devtools/performance#track-widget-builds), [layouts](https://docs.flutter.dev/tools/devtools/performance#track-layouts), and [paints](https://docs.flutter.dev/tools/devtools/performance#track-paints) to help users diagnose where their app is experiencing bottlenecks.

However, if the app has high frame rates, they can experience data loss in DevTools because the perf events overflow the ring buffer before they can analyze them.

### Possible solutions

**1. Table of slowest widget builds, layouts, or paints.**

Along with displaying the data in the flame chart, we could also sort the data and display the slowest phases at the top of a table to help users quickly identify where their app is experiencing issues.

_Estimated scope: S/M (1 week - 1 month)_

**2. Disabling widgets from the performance view**

The user suggested a possible solution of disabling widgets from the performance view. This is a significantly more challenging request. Currently, the Flutter engine is responsible for emitting the build, layout, and paint events. The Dart VM Service listens to these events, and adds them to a ring buffer. The primary challenge here is communicating with the Flutter engine to not emit the events for certain widgets, either with a service extension registered on the framework, or perhaps an annotation that users can add to their widget source code.

_Estimated scope: XL (quarter+)_

----

See original request [here](https://x.com/ThomasBurkhartB/status/1990839130998116376)

贡献指南

打开贡献指南

调研方向

先从 Performance Panel 现有的 widget 构建、布局和绘制跟踪开始,然后追踪 Flutter engine 事件如何到达 Dart VM Service 的 ring buffer。该 issue 提出了两个范围截然不同的替代方案,因此必须先就完成标准和实现入口达成一致,之后才能开始工作。

由索引模型根据 Issue 内容生成。

评估

技术栈
dart
领域
performance, tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。