Performance improvements to CPU profile code #7917
Labels
dart2wasm
devtools app performance
Related to the performance of the DevTools app (not the Performance page)
P2
important to work on, but not at the top of the work list.
product-quality
Issues related to product quality.
screen: cpu profiler
Issues related to the CPU Profiler screen
After having taken a look at the cpu profiling code in DevTools, we found:
Stream</* String | List<int> */>
from the websocket and then json decodes strings=> It would be more efficient to avoid going from utf-8 to string and then to json and instead directly from utf8->json
=> This would probably require some refactoring in various packages, so maybe not easily doable?
package:vm_service layer
package:vm_service
layer (e.g.vm_service.CpuSamples
,vm_service.CpuSample
)_CpuProfileTimelineTree
tree structure=> Uses expandos (!!) to map service objects back to tree nodes
_CpuProfileTimelineTree
-> JSON "traceObject" (very expensive operation!)CpuProfileData.fromJson
which builds json maps with strings andCpuStackFrame
as valuesIt seems there's too many conversions from one data structure to another and the representations used for encoding this profiling information doesn't seem very efficient either.
The text was updated successfully, but these errors were encountered: