Skip to content

Converting a class to a mixin caused a 1-3% increase in read only snapshot size. #37126

@gspencergoog

Description

@gspencergoog

Why did this change cause a 1%-3% regression several of Flutter's regression tests? The tests are all readonly data size tests. It's simply moving the implementation of a class into a mixin.

Essentially, the change was:

Before:

class Diagnosticable {
  const Diagnosticable();
  // ... functions
}

And now it's:

class Diagnosticable with DiagnosticableMixin {
  const Diagnosticable();
}

mixin DiagnosticableMixin {
  // ... funtions
}

Attached are two snapshot heap dumps: one before the change, and one after. I wasn't able to get them to load in Chrome's dev tools but the data is there, at least.

heap_snapshots.zip

Snapshot size of Flutter Gallery app before (f38ee15):
app.dill: 21014104
isolate_snapshot_data: 4152976
isolate_snapshot_instr: 7263408

Snapshot size of Flutter Gallery app after (c7c0965):
app.dill: 21021520 (0.03% increase)
isolate_snapshot_data: 4232280 (1.9% increase)
isolate_snapshot_instr: 7279664 (0.2% increase)

Version: Dart VM version: 2.3.2-dev.0.0.flutter-fee615c5a5 (Tue May 28 17:01:16 2019 +0000) on "linux_x64"

Metadata

Metadata

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.type-performanceIssue relates to performance or code sizevm-regression

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions