flutter / flutter/devtools

Refactor `cpu_profile_model` to prevent side effects

Open
#9,353 0 comments 0 reactions 0 assignees View on GitHub
P3 screen: cpu profiler
Dominant language
Dart
Stars
1.7k
Forks
404
Avg merge
6d 17h
Merged PRs (30d)
18

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.