Refactor `cpu_profile_model` to prevent side effects
未关闭
P3
screen: cpu profiler
- 主要语言
- Dart
- 星标
- 1.7k
- 派生
- 404
- 平均合并
- 6 天 17 小时
- 30 天内合并 PR
- 18
描述
The functions called in `generateFromCpuSamples` must be called in that particular order. This is because of function side effects:
1. Generating the stack frames both creates the timeline tree and assigns frame IDs to every node in the tree
2. Creating the sample events expects that the tree has already been created, and that the frame IDs have been assigned to every node
Ideally we should refactor the code so that we aren't dependent on hidden side effects.
贡献指南
调研方向
从 cpu_profile_model 中的 generateFromCpuSamples 开始,按要求的顺序跟踪它调用的函数。重构流程,使树的创建和 frame-ID 分配变得明确,而不是隐藏的副作用,同时保留 sample-event 生成和现有的 profiling 行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- dart
- 领域
- devtools, performance
- Issue 类型
- 重构
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100