flutter / flutter/devtools

Migrate to requesting Perfetto timelines containing interned strings from the VM Service

Open
#9,075 2 comments 0 reactions 0 assignees View on GitHub
devtools app performance P2 screen: performance
Dominant language
Dart
Stars
1.7k
Forks
404
Avg merge
6d 17h
Merged PRs (30d)
18

Description

@mraleph has made it possible for the VM Service to return Perfetto-format timeline protos with interned strings, which can be much smaller than protos without interned strings. A measurement that he recorded showed that a timeline containing 60k slices went from 15MB to 5MB once interned strings were used. The Perfetto trace viewer knows how to decode interned strings, but since DevTools reads the data in timeline protos itself, it will need to be migrated before it can take advantage of the size reduction.

To migrate, DevTools needs to upgrade to `package:vm_service_protos 2.0.0`, and then implement deinterning as done in https://github.com/dart-lang/sdk/blob/cfeda654176d7c2cf006eeef269a458cdf977f32/pkg/vm_service/test/get_perfetto_vm_timeline_rpc_test.dart#L42. To test the migration, the VM flag `--intern-strings-when-writing-perfetto-timeline` makes it so that `getPerfettoVMTimeline` VM Service RPCs return protos with interned strings. Once the migration is complete, `--intern-strings-when-writing-perfetto-timeline` can become the VM's default behaviour.

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.