-
Notifications
You must be signed in to change notification settings - Fork 366
Open
Labels
P2important to work on, but not at the top of the work list.important to work on, but not at the top of the work list.dart2wasmdevtools app performanceRelated to the performance of the DevTools app (not the Performance page)Related to the performance of the DevTools app (not the Performance page)product-qualityIssues related to product quality.Issues related to product quality.screen: cpu profilerIssues related to the CPU Profiler screenIssues related to the CPU Profiler screen
Description
After having taken a look at the cpu profiling code in DevTools, we found:
- It unnecessarily encodes json maps and decodes them again: devtools/pull/7916
- It gets
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? - Way too many conversions
- Bytes->String in websocket layer
- String->JSON in
package:vm_service layer - JSON -> service objects in
package:vm_servicelayer (e.g.vm_service.CpuSamples,vm_service.CpuSample) - service objects ->
_CpuProfileTimelineTreetree structure
=> Uses expandos (!!) to map service objects back to tree nodes _CpuProfileTimelineTree-> JSON "traceObject" (very expensive operation!)- Going from JSON "traceObject" back to normal objects in
CpuProfileData.fromJsonwhich builds json maps with strings andCpuStackFrameas values
It 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.
Metadata
Metadata
Assignees
Labels
P2important to work on, but not at the top of the work list.important to work on, but not at the top of the work list.dart2wasmdevtools app performanceRelated to the performance of the DevTools app (not the Performance page)Related to the performance of the DevTools app (not the Performance page)product-qualityIssues related to product quality.Issues related to product quality.screen: cpu profilerIssues related to the CPU Profiler screenIssues related to the CPU Profiler screen