* Remove ~2.8mb of iterators in SourceMethodBuilder * Remove ~0.7mb of iterators in calculateBounds * Remove ~1.7 mb of iterators in ClassMembersNodeBuilder.build * Remove ~1.9mb of iterators in BuilderFactory.computeBuildersByName * Remove ~3mb of iterables and iterators in findRecordUseAnnotation * Remove ~3mb of allocations from List.iterator in InferenceVisitorBase._inferInvocation * Another ~6.3mb of iterables in various places in chunks of ~100-800kb. Running a benchmark of the CFE compiling the CFE I get this: ``` msec task-clock:u: -5.9719% +/- 0.3845% (-342.77 +/- 22.07) (5739.61 -> 5396.84) page-faults:u: -2.6307% +/- 0.0630% (-2951.12 +/- 70.63) (112178.18 -> 109227.06) cycles:u: -6.1751% +/- 0.3921% (-1471343183.50 +/- 93434420.74) (23827045867.84 -> 22355702684.34) instructions:u: -5.0116% +/- 0.0006% (-1385443477.90 +/- 176957.44) (27644543467.86 -> 26259099989.96) branch-misses:u: -6.0357% +/- 1.7661% (-5562845.14 +/- 1627775.60) (92165665.40 -> 86602820.26) seconds time elapsed: -5.9868% +/- 0.3830% (-0.34 +/- 0.02) (5.75 -> 5.40) seconds user: -6.0365% +/- 0.4515% (-0.33 +/- 0.02) (5.47 -> 5.14) seconds sys: -4.6542% +/- 3.6415% (-0.01 +/- 0.01) (0.27 -> 0.26) Scavenge( new space) goes from 64 to 63 MarkSweep( promotion) goes from 9 to 8 Evacuate(store buffer) goes from 2 to 1 ``` Worth noticing, though, is that the before numbers (e.g. 5739.61 ms task-clock:u) is very close to the before numbers from https://dart-review.googlesource.com/c/sdk/+/438681 (5767.31 ms) and not the after numbers on that cl (5478.56 ms) --- so something weird is going on here. Change-Id: I67248bbde47900435ababcb1a2d5ecff2dde5c13 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438722 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
Dart Kernel
Dart Kernel is a small high-level language derived from Dart. It is designed for use as an intermediate format for whole-program analysis and transformations, and to be consumed by codegen and execution backends.
The kernel language has an in-memory representation in Dart and can be serialized as binary or text.
Both the kernel language and its implementations are unstable and are under development.
This package contains the Dart part of the implementation and contains:
- A transformable IR for the kernel language
- Serialization of kernel code
Note: The APIs in this package are in an early state; developers should be careful about depending on this package. In particular, there is no semver contract for release versions of this package. Please depend directly on individual versions.
See ast.dart for the in-memory IR, or binary.md for a description of the binary format. For now, the textual format is very ad-hoc and cannot be parsed back in.