Remove intermediary JSON conversion from generateFromCpuSamples#9354
Merged
elliette merged 10 commits intoflutter:masterfrom Aug 7, 2025
Merged
Remove intermediary JSON conversion from generateFromCpuSamples#9354elliette merged 10 commits intoflutter:masterfrom
generateFromCpuSamples#9354elliette merged 10 commits intoflutter:masterfrom
Conversation
generateFromCpuSamplesgenerateFromCpuSamples
Member
Author
|
Note: Added a benchmark test to try to measure performance gains. Unfortunately seems pretty minimal, but I do think the code is cleaner without this step. Benchmarks before this change: 29814.323529411766 Benchmarks after this change: 29160.1884057971 |
bkonyi
approved these changes
Aug 5, 2025
Contributor
bkonyi
left a comment
There was a problem hiding this comment.
Nice! Thanks for fixing my questionable code 😉
packages/devtools_app/lib/src/screens/profiler/cpu_profile_model.dart
Outdated
Show resolved
Hide resolved
hrajwade96
pushed a commit
to hrajwade96/devtools
that referenced
this pull request
Sep 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Work towards #7917
Refactors
generateFromCpuSamplesto remove the intermediary JSON conversion step.Before this PR:
generateFromCpuSampleswent fromvm_service.CpuSamples-> serialized to JSON -> deserialized toCpuProfileData:With this PR:
generateFromCpuSamplesgoes fromvm_service.CpuSamples->CpuProfileDataNote: I filed #9353 to refactor this method more to avoid side-effects - the call to generate the stack frames creates the timeline tree and assigns frame IDs to every node in the tree. This was true before this change as well. However, I didn't want to change too much at once in this PR.