2

Is there any way to get the Dart2JS compiler to minimize time to output in any significant way? For example, is it possible to get it to compile only files which have been changed since the last compilation?

For context, I am experimenting with Dartangular. Compiling even a trivial hello world example takes 15-20 seconds, which in the long run becomes untenable to work with.

csvan
  • 8,782
  • 12
  • 48
  • 91
  • It is not possible to use something like `make` with dart2js because dart2js builds all its dependencies automatically. – 0xcaff Mar 02 '14 at 16:10

2 Answers2

1

Recently dart2js had an issue which caused it to frequently run out of memory when to many tasks were run in parallel. To fix this issue they limited the number of tasks that can be run in parallel. This greatly slowed down the compilation speed but fixed the memory issue.

Development is usually done only in Dart and there is no compilation to JavaScript involved. This is mostly a deployment task. Of course it's also necessary to test the built result, so it is still important that it is fast.

As far as I know the Dart team is still working on it.

0xcaff
  • 13,085
  • 5
  • 47
  • 55
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
1

There is one option to increase heap size. and this will fix the run out of memory issue @Günter Zöchbauer mentioned,

--old_gen_heap_size=MEGABYTE_SIZE

For instance, --old_gen_heap_size=2048.

But i'm not quite sure this will speed up compilzation.

Sungguk Lim
  • 6,109
  • 7
  • 43
  • 63
  • 1
    Thanks for adding this info. But as they removed parallel processing the out of memory issue is gone (at least for the project I was not able to build to JS the last two months). – Günter Zöchbauer Mar 02 '14 at 18:11
  • oh thank you for the information, I'll aplly that to my project :) @GünterZöchbauer – Sungguk Lim Mar 02 '14 at 18:38