Remove CPU profiler from legacy trace viewer #5539
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The legacy trace viewer pulls a CPU profile when an event from the UI thread is selected. This profile would be shown at the bottom. The profiler has minimal samples for an event like this and doesn't allow for showing samples that spanned multiple events / flutter frames.
The legacy trace viewer is off by default (replaced with perfetto) and only accessible by enabling the setting 'Use legacy trace viewer'. At some point, we will likely remove the legacy trace viewer entirely (#5466), but for now, this PR removes the profiler from the legacy view to reduce the maintenance burden and to simplify where we need to do things like set the cpu sampling rate in initialization. When we switch to the protozero format, the perfetto view will have cpu samples included in the data (#4755).
This will also reduce the cost of having a higher sampling rate by default when a user opens the performance page. We will now only increase the sampling rate when a user opens the CPU profiler page. In the future, once the perfetto view supports showing CPU samples in the timeline, we will add a setting to the Performance page that allows a user to increase the CPU sampling rate if they choose to, but not by default. CC @dnfield - addresses part of your concerns.