No description
Find a file
Aske Simon Christensen cec963f028 The current growth strategy for growable arrays allocates a backing array of size 2 at (empty) creation and doubles the size whenever the capacity is insufficient while adding elements.
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 .
2017-06-22 10:51:54 +02:00
build Use assembly instead of C array literals to link the core snapshot into the VM. 2017-05-24 14:38:15 -07:00
client Remove old annotated_steps buildbot scripts and dispatcher 2017-05-23 16:17:02 +02:00
docs/language Add informal specification for optional-new/const, constructor tearoffs. 2017-06-20 13:21:36 +02:00
pkg Fix mocked operator methods 2017-06-21 16:54:08 -07:00
runtime The current growth strategy for growable arrays allocates a backing array of size 2 at (empty) creation and doubles the size whenever the capacity is insufficient while adding elements. 2017-06-22 10:51:54 +02:00
samples Revert "Revert "Revert "Revert "Refactor test option parsing code."""" 2017-05-26 15:04:55 -07:00
samples-dev Fix swarm for non-integer Event timeStamps 2017-05-10 12:48:39 -07:00
sdk Added timeout parameter to RawSocket and Socket connect, which allows for the specification of a maximum time to wait for a valid connection to be established. 2017-06-21 14:31:52 -07:00
tests Fix mocked operator methods 2017-06-21 16:54:08 -07:00
third_party Fix ARMv6 Linux cross-build 2017-05-22 13:15:33 -07:00
tools Basic support for dev_compiler in test.dart. 2017-06-21 13:19:28 -07:00
utils Mostly revert "[fuchsia] Prepare for setting the Dart target architecture appropriately in the host binaries." 2017-06-21 15:19:21 -07:00
.clang-format Add .clang-format and run clang-format on runtime/platform. 2016-11-03 14:25:16 -07:00
.gitattributes Restore line endings of files that should be CRLF. 2016-12-09 11:09:55 -08:00
.gitignore Git ignore vscode project files. 2017-03-23 15:26:06 -07:00
.gn Starting work on full GN build 2016-09-23 07:47:36 -07:00
.mailmap Add .mailmap file. 2015-05-18 19:33:16 +02:00
.packages Upgrade dartdoc to v0.12.0. 2017-06-16 07:51:13 -07:00
.travis.yml Allow canary to timeout 2017-05-02 10:02:51 -07:00
AUTHORS Add Cristian Almstrand to AUTHORS 2015-07-16 09:51:56 -07:00
BUILD.gn [Fuchsia] Really remove dead GN flag 2017-05-23 22:18:39 -07:00
CHANGELOG.md Added timeout parameter to RawSocket and Socket connect, which allows for the specification of a maximum time to wait for a valid connection to be established. 2017-06-21 14:31:52 -07:00
codereview.settings Remove trailing slash in codereview.settings to fix review url double slash 2015-10-01 07:27:13 -07:00
create_sdk.gyp Make list_files.py and list_dart_files.py return absolute paths for GN 2016-12-13 10:01:28 -08:00
dart.gyp Remove dart_noopt and related parts from the VM. 2017-01-11 16:55:55 -08:00
DEPS Update dartdoc to v0.13.0+1. 2017-06-21 07:58:25 -07:00
LICENSE Remove the Dromaeo and TodoMVC samples. 2016-01-11 13:09:26 -08:00
PATENTS Move LICENSE, AUTHORS, PATENTS into the dart directory. 2014-02-10 06:48:47 +00:00
PRESUBMIT.py Print the correct path to dartfmt in the presubmit error message. 2017-04-04 16:13:31 -07:00
README.dart-sdk remove docgen from the sdk 2015-09-18 13:18:10 -07:00
README.md [gardening] Whitespace change to trigger bots. 2017-04-28 10:08:58 -07:00
WATCHLISTS [infra] Fix Observatory watchlist. 2017-06-13 16:21:35 -07:00

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.

License & patents

See LICENSE and PATENTS.