[dart2js] Improve dump info scalability.

Isolates data needed from emitter phase for dump info task. The new DumpInfoProgramData captures only the necessary data and allows it to be serialized so that dump info can be run independently of the emitter task.

This change also ends up improving the combined emitter and dump info task. By processing the JS AST and extracting out the relevant info up front, the AST is able to be GCed before the dump info task runs. In local runs on a big app this resulted in ~1.4GB less ram being.

Runtime stat comparison:
Without --dump-info: 117s 5.4GB

Before with --dump-info: 205s 18.3GB
Before with --dump-info=binary: 148s 9.9GB

After with --dump-info: 205s 16.9GB
After with --dump-info=binary: 150s 7.5GB

After with --dump-info-write: 132s 6.2GB
After with --dump-info-read: 118s 14.8GB
After with --dump-info-read --dump-info=binary: 67.9s 5.5GB

By providing the new "--dump-info-write-uri=URI" a binary file will be written with the necessary dump info data. Then if Dart2JS is invoked with the same parameters and "--dump-info-read-uri=URI" then the compiler will skip generating/emitting JS and use the output file to generate the info dump. The existing invocation of just adding "--dump-info" works as before.

I also had the goal of removing DumpInfoTask dependencies on other parts of the compiler and vice versa.

Change-Id: I3f40b0136eb77a709c49737607a2ad6127127e49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322843
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
19 files changed
tree: b676d0655dee4860217f33bbb5a6a853ba93e1fd
  1. .dart_tool/
  2. .github/
  3. benchmarks/
  4. build/
  5. docs/
  6. pkg/
  7. runtime/
  8. samples/
  9. sdk/
  10. tests/
  11. third_party/
  12. tools/
  13. utils/
  14. .clang-format
  15. .gitattributes
  16. .gitconfig
  17. .gitignore
  18. .gn
  19. .mailmap
  20. .style.yapf
  21. .vpython
  22. AUTHORS
  23. BUILD.gn
  24. CHANGELOG.md
  25. codereview.settings
  26. CONTRIBUTING.md
  27. DEPS
  28. LICENSE
  29. OWNERS
  30. PATENT_GRANT
  31. PRESUBMIT.py
  32. README.dart-sdk
  33. README.md
  34. sdk.code-workspace
  35. sdk_args.gni
  36. SECURITY.md
  37. WATCHLISTS
README.md

Dart

A client-optimized language for fast apps on any platform

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 platforms illustration

License & patents

Dart is free and open source.

See LICENSE and PATENT_GRANT.

Using Dart

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).

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.