flutter / flutter/devtools

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

Đang mở
#9,606 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
cost: high new feature P3 screen: performance
Ngôn ngữ chính
Dart
Star
1.7k
Fork
404
Merge trung bình
6 ngày 17 giờ
Pull request đã merge (30 ngày)
18

Mô tả

### 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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với việc theo dõi hiện có của Performance Panel đối với việc build widget, layout và paint, sau đó truy vết cách các sự kiện của Flutter engine đến được ring buffer của Dart VM Service. Issue đưa ra hai phương án có phạm vi rất khác nhau, vì vậy cần thống nhất các tiêu chí hoàn thành và một điểm bắt đầu triển khai trước khi có thể bắt đầu công việc.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
dart
Lĩnh vực
performance, tooling
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.