Incremental compilation update

92 views
Skip to first unread message

Peter Ahé

unread,
Jun 4, 2014, 9:40:35 AM6/4/14
to compil...@dartlang.org
I'm making good progress on the Try Dart scenario of incremental compilation, compile-times for hello-world (HTML) are improving: https://plus.google.com/104729279175870053531/posts/A4teh5Q4RyY

I've made some experiments that indicate that I might be able to hit 15ms for incremental compilation of hello-world (HTML).  I think that is sufficient to achieve my goal: http://worrydream.com/#!/InventingOnPrinciple

The trick is then to be able to scale this up to large applications by recompiling only methods that are affected by a change. Ideally, compile times will be proportional to the impact of a change.  That is why there is still a lot of work to do in this area.

To ensure incremental compilation is robust, I've started writing a test where I compile all provided files using the same compiler (aka incremental compilation). Eventually, I want to use fuzzing as well, but for now, compiling all language and dart2js_extra tests reveal enough problems to keep me busy.

This test is rather fast, and there are surprisingly few problems to address:

Total: 1557 tests
 * 90 tests (5.780%) cancelled the compiler
 * 0 tests (0.000%) crashed the compiler
 * 57 tests (3.661%) were skipped (as they would cause a crash)


real 1m29.555s
user 1m27.276s
sys 0m3.408s

Notice that this is using a single CPU. Hopefully, we can find a way to use this to make dart2js engineers more productive by having a fast way to run all tests. 

Cheers,
Peter

Bob Nystrom

unread,
Jun 4, 2014, 12:36:42 PM6/4/14
to Peter Ahé, compil...@dartlang.org
This sounds awesome!

When can we start experimenting with this in pub serve?

- bob


To unsubscribe from this group and stop receiving emails from it, send an email to compiler-dev...@dartlang.org.

Peter Ahé

unread,
Jun 4, 2014, 3:48:49 PM6/4/14
to Bob Nystrom, compil...@dartlang.org
I'll try getting it neatly packaged up soon so you and Devon (spark) can start experimenting with it.

It will take a while before it is production ready. For example, the crashes I mention below. In addition, I'm aware that the compiled code sometimes is broken. This means that I need more testing.

I'm guesstimating it will take months before it is stable enough, and more months after that until it is truly incremental.

Cheers,
Peter

Bob Nystrom

unread,
Jun 4, 2014, 4:46:32 PM6/4/14
to Peter Ahé, compil...@dartlang.org

On Wed, Jun 4, 2014 at 12:48 PM, Peter Ahé <a...@google.com> wrote:
It will take a while before it is production ready. For example, the crashes I mention below. In addition, I'm aware that the compiled code sometimes is broken. This means that I need more testing.

Understood. I realize it will be a while before we can actually use it for real. But, even before then, it would be interesting to try to hack it in on an experimental basis just to see what the user experience feels like.

If we can get this working, even just barely, in pub serve, then we can try:

1. Open an app in the Editor.
2. Run pub serve.
3. Hit the app in some browser.
4. Change some code.
5. Refresh the browser.
6. Go to 4.

Having dart2js in pub serve at all already makes it feel like Dart sort of magically works in all browsers. Getting the delay down will make it even more seamless.

Cheers!

- bob
Reply all
Reply to author
Forward
0 new messages