mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 10:49:00 +00:00
No description
cec963f028
I collected statistics for the sizes and capacities of growable arrays which are promoted to old-space or survive an old-space gc when running dart2js and Fasta. For these applications, the vast majority of arrays stay empty. More than half of the total object size of promoted backing arrays is backing for empty growable arrays. Furthermore, since the overhead for an array is 3 words (header, type parameters and length), and object sizes are rounded up to an even number of words, we waste one word for all even-sized arrays. This CL changes the growth strategy so that empty growable arrays are created with a shared, zero-sized array as backing, avoiding the allocation of a backing array if no elements are added. When the array needs to grow, it starts out at 3 and grows to double size plus one each time: 7, 15, 31, ... A few places in the VM code need to handle these shared, zero-sized arrays specially. In particular, the Array::MakeArray function needs to allocate a new, empty array if its result is to be returned to Dart code. Benchmarks suggest that the change improves memory usage by a few percent overall and does not significantly affect run time. BUG= R=erikcorry@google.com Review-Url: https://codereview.chromium.org/2949803002 . |
||
---|---|---|
build | ||
client | ||
docs/language | ||
pkg | ||
runtime | ||
samples | ||
samples-dev | ||
sdk | ||
tests | ||
third_party | ||
tools | ||
utils | ||
.clang-format | ||
.gitattributes | ||
.gitignore | ||
.gn | ||
.mailmap | ||
.packages | ||
.travis.yml | ||
AUTHORS | ||
BUILD.gn | ||
CHANGELOG.md | ||
codereview.settings | ||
create_sdk.gyp | ||
dart.gyp | ||
DEPS | ||
LICENSE | ||
PATENTS | ||
PRESUBMIT.py | ||
README.dart-sdk | ||
README.md | ||
WATCHLISTS |
Dart
Dart is an open-source, scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps.
Using Dart
Visit the dartlang.org to learn more about the language, tools, getting started, and more.
Browse pub.dartlang.org for more packages and libraries contributed by the community and the Dart team.
Building Dart
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.
Contributing to Dart
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.