Find a file
Jens Johansen 6e2536f585 [kernel] Change dill representation of doubles
Previously doubles was saved as strings in the string table,
with a DoubleLiteral holding a StringReference.

This can cause overhead in both computation time
(converting the double to and from string) as well as size
(e.g. a single usage of the previously unused double 1000000.42
would use (at least)
* 10 bytes for the characters
* 1 byte for the size
* 1 byte for the reference to the string

whereas saving it as a double would simply save the 8 bytes.

On the other hand the string table doesn't contain duplicates so
many usages of the same double will use more space.

The SDK dill file size decreases slightly (< 1 KB).

On a Dart file with 1M different doubles (0.42, 1.42, ..., 999999.42)
added to a list:

Before:

compile and write via fasta (non-strong-mode): 0:12.18
Reading (via dart, eager): 2500-2600 ms
Writing (to null sink) (after reading): 1600-1800 ms
Output dill file (via fasta compile): ~62 MB

After:

compile and write via fasta (non-strong-mode): 0:11.76
Reading (via dart, eager): 2050-2350 ms
Writing (to null sink) (after reading): 400-550 ms
Output dill file (via fasta compile): ~54 MB

Running the dill file is ~the same time, but "Maximum resident set size
(kbytes)" (from /usr/bin/time -v) decreases with ~4%.

On the other side, if it's 1M of the same doubles (0.42), while
compiling is ~the same speed, the output dill goes from 43MB to 50MB.
Surprisingly the "Maximum resident set size (kbytes)" still decreases
though (~3%).

Running flutter test in flutter/packages/flutter:

Before:
```
02:33 +2425 ~18: All tests passed!
02:28 +2425 ~18: All tests passed!
02:28 +2425 ~18: All tests passed!
```

After:
```
02:12 +2425 ~18: All tests passed!
02:11 +2425 ~18: All tests passed!
02:12 +2425 ~18: All tests passed!
```

So that's -12.0267% +/- 3.15253%

File size of a dill file of an arbitrary test using flutter is reduced by ~44 KB (~0.3%).

Change-Id: I64151376cde1dae6f0d02b3d96991bc432a994ae
Reviewed-on: https://dart-review.googlesource.com/41660
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-05-01 09:35:21 +00:00
.github Add an issue template to the SDK 2018-04-05 13:05:09 +00:00
build [infra] Use a relative path for the Linux sysroot 2018-04-18 21:14:23 +00:00
client Remove old annotated_steps buildbot scripts and dispatcher 2017-05-23 16:17:02 +02:00
docs Fixed a couple of typos in subtyping.md 2018-04-13 05:59:02 +00:00
pkg [kernel] Change dill representation of doubles 2018-05-01 09:35:21 +00:00
runtime [kernel] Change dill representation of doubles 2018-05-01 09:35:21 +00:00
samples [infra] Keep comments intact when updating status files. 2018-04-10 19:03:21 +00:00
samples-dev Remove uses of upper-case constants in remaining SDK code. 2018-04-16 16:11:57 +00:00
sdk Support js-interop classes that implement generic types in Dart 2 2018-05-01 08:37:11 +00:00
tests Support js-interop classes that implement generic types in Dart 2 2018-05-01 08:37:11 +00:00
third_party [infra] Keep comments intact when updating status files. 2018-04-10 19:03:21 +00:00
tools [infra] Upgrade checked in SDKs to 2.0.0-dev.51.0 2018-05-01 08:39:01 +00:00
utils [build] Remove unnecessary inputs from uses of application_snapshot. 2018-04-16 21:13:09 +00:00
.clang-format VM: Re-format to use at most one newline between functions 2017-07-13 08:08:37 -07:00
.gitattributes Avoid crash on EOF error in file with Windows line encoding 2018-04-09 12:16:20 +00: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 Readd web-components: it is used for unit tests of dart:html 2018-04-03 20:13:19 +00:00
AUTHORS Add Cristian Almstrand to AUTHORS 2015-07-16 09:51:56 -07:00
BUILD.gn [gn] Propagate outputs up to //create_sdk. 2018-04-24 16:03:45 +00:00
CHANGELOG.md [release] Merge changelog corrections from dev branch 2018-05-01 08:38:33 +00:00
codereview.settings Update codereview.settings to Gerrit (dart-review.googlesource.com) 2017-09-04 12:52:09 +00:00
dartdoc_options.yaml Update dartdoc to v0.18.0 and tag library categories. 2018-03-27 16:19:34 +00:00
DEPS Roll dart_style to 1.0.12. 2018-05-01 00:05:21 +00: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 Move new tests from tests/isolate to tests/lib_2/isolate. 2018-02-22 10:03:23 +00: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 Creates a watchlist for sdk/lib/_http and adds me to it 2018-01-02 18:39:53 +00: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.