Use fixed-length List where possible. In short: Heap size: -155 MB, about 9% Object count: -4.6 * 10^6, about 20% rwf-materials/01-setting-up-your-environment === Before. [Analysis contexts: 35] [time: 16521 ms] [26802 ms] Created HeapSnapshotGraph. externalSize: 1984 shallowSize: 1757489376 Objects: 23454755 [26803 ms] Created Analysis. All objects. size count class -------- -------- -------- 278670 kb 2110088 _OneByteString dart:core 270497 kb 2090817 _List dart:core 229974 kb 2066512 _Uint32List dart:typed_data 154250 kb 4936008 _GrowableList dart:core 63129 kb 160607 _Uint8List dart:typed_data 56224 kb 1199459 Reference package:analyzer/src/summary2/reference.dart 42643 kb 682297 _InfoMethodDeclaration package:analyzer/src/summary2/informative_data.dart 40358 kb 234812 PropertyAccessorElementImpl_ImplicitGetter package:analyzer/src/dart/element/element.dart 38075 kb 203067 ConstFieldElementImpl package:analyzer/src/dart/element/element.dart 32181 kb 686528 _InfoFormalParameter package:analyzer/src/summary2/informative_data.dart 29730 kb 475685 _Closure dart:core 27724 kb 6868 _TwoByteString dart:core 25594 kb 409516 _Map dart:collection 17778 kb 81273 ClassElementImpl package:analyzer/src/dart/element/element.dart 16479 kb 411894 Context 14672 kb 93903 LibraryImportElementImpl package:analyzer/src/dart/element/element.dart 14074 kb 90077 ParameterElementImpl package:analyzer/src/dart/element/element.dart 13316 kb 284078 _InfoFieldDeclaration package:analyzer/src/summary2/informative_data.dart 13138 kb 19582 Instructions 11985 kb 191772 InterfaceTypeImpl package:analyzer/src/dart/element/type.dart -------- -------- 1701770 kb 23237353 Instances of: _GrowableList size count class -------- -------- -------- 154250 kb 4936008 _GrowableList dart:core Instances of empty: _GrowableList size count class -------- -------- -------- 119542 kb 3825345 _GrowableList dart:core === After [Analysis contexts: 35] [time: 16946 ms] [24964 ms] Created HeapSnapshotGraph. externalSize: 1984 shallowSize: 1611104288 Objects: 18819706 [24965 ms] Created Analysis. All objects. size count class -------- -------- -------- 278679 kb 2110125 _OneByteString dart:core 265723 kb 2097564 _List dart:core 229974 kb 2066512 _Uint32List dart:typed_data 62996 kb 158742 _Uint8List dart:typed_data 56224 kb 1199459 Reference package:analyzer/src/summary2/reference.dart 42643 kb 682297 _InfoMethodDeclaration package:analyzer/src/summary2/informative_data.dart 40358 kb 234812 PropertyAccessorElementImpl_ImplicitGetter package:analyzer/src/dart/element/element.dart 38075 kb 203067 ConstFieldElementImpl package:analyzer/src/dart/element/element.dart 32181 kb 686528 _InfoFormalParameter package:analyzer/src/summary2/informative_data.dart 29730 kb 475685 _Closure dart:core 27724 kb 6868 _TwoByteString dart:core 25594 kb 409516 _Map dart:collection 17778 kb 81273 ClassElementImpl package:analyzer/src/dart/element/element.dart 16479 kb 411894 Context 14672 kb 93903 LibraryImportElementImpl package:analyzer/src/dart/element/element.dart 14074 kb 90077 ParameterElementImpl package:analyzer/src/dart/element/element.dart 13316 kb 284078 _InfoFieldDeclaration package:analyzer/src/summary2/informative_data.dart 13117 kb 19633 Instructions 11985 kb 191772 InterfaceTypeImpl package:analyzer/src/dart/element/type.dart 11520 kb 184326 FieldElementLinkedData package:analyzer/src/summary2/bundle_reader.dart -------- -------- 1546419 kb 18428158 Instances of: LibraryElementImpl size count class -------- -------- -------- 4491 kb 15129 LibraryElementImpl package:analyzer/src/dart/element/element.dart Instances of: _GrowableList size count class -------- -------- -------- 3795 kb 121445 _GrowableList dart:core Instances of empty: _GrowableList size count class -------- -------- -------- 2075 kb 66426 _GrowableList dart:core Change-Id: I4ed72298a2361e9fe004bef5482a9f8bae5de6df Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279644 Reviewed-by: Samuel Rawlins <srawlins@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Dart is:
Optimized for UI: Develop with a programming language specialized around the needs of user interface creation.
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app.
Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web.
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Visit dart.dev to learn more about the language, tools, and to find codelabs.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.