JS vs Dart2JS (Performance Benchmarks)

436 views
Skip to first unread message

Si Robertson

unread,
Jun 26, 2014, 11:39:50 AM6/26/14
to mi...@dartlang.org
Hi guys,

What's the difference between js and dart2js in the Dart performance benchmarks?

I'm hoping js doesn't mean handwritten JS.

Bob Nystrom

unread,
Jun 26, 2014, 12:02:25 PM6/26/14
to General Dart Discussion

On Thu, Jun 26, 2014 at 8:39 AM, Si Robertson <retrom...@gmail.com> wrote:
I'm hoping js doesn't mean handwritten JS.

Yes, the "js" score is hand-written JS. It attempts to reflect "real-world" JavaScript, normal JS code as a regular developer would write it, and not heavily hand-optimized. (The Dart code likewise is written to be normal, idiomatic Dart code.)

- bob

Si Robertson

unread,
Jun 26, 2014, 12:18:05 PM6/26/14
to mi...@dartlang.org
So, based on the performance benchmarks, optimized handwritten JS would run much faster than JS generated by dart2js. Not cool but I guess that makes sense.

I really hope the Dart VM makes it way into Chrome soon.

Jos Hirth

unread,
Jun 26, 2014, 12:23:33 PM6/26/14
to mi...@dartlang.org
If you ignore Halvak (which is very new), the generated JavaScript is a bit faster on average.

Not really sure where you got that "much faster" from.

Si Robertson

unread,
Jun 26, 2014, 12:50:50 PM6/26/14
to mi...@dartlang.org
I get that "much faster" from the performance benchmarks. All of the benchmarks, except for Tracer, show js to be faster than dart2js. Optimized JS would be even faster, therefore optimized handwritten JS (possibly pushed through the Closure compiler) would be much faster than JS generated by dart2js.

Don't get me wrong, I do want to start using Dart (and have been keeping a close eye on it for a long time) but I want to use it for the runtime performance, the strictly-typed aspect of it is simply a bonus which other tools/solutions already provide.

David Kerr

unread,
Jun 26, 2014, 12:51:33 PM6/26/14
to mi...@dartlang.org
As I understand things (from a superficial level only), dart2js can make global optimizations across ALL the code, which a "normal" developer would be very unlikely to be willing to do. Optimization typically makes the source code harder for a human being to read and maintain. Dart2js doesn't need to care and can make the global optimizations (whatever makes for fast JS).

Just my 2 pence

Alan Humphrey

unread,
Jun 26, 2014, 12:59:49 PM6/26/14
to mi...@dartlang.org
The real question is whether the dart2js output is fast enough for your application.


--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.

Jos Hirth

unread,
Jun 26, 2014, 2:07:15 PM6/26/14
to mi...@dartlang.org
The handwritten JavaScript *is* optimized well-written code. Also, as far as I know, the Closure Compiler doesn't really improve runtime performance. It's more about file size.

If you ignore Halvak, the current average is about 97%. 2 weeks ago it was around 103%. A month ago it was 105%-ish including Halvak.

Also, if you zoom out a bit, you'll see how everything has improved quite a bit within just one year. A few percent don't really hurt. The difference will be offset in a few weeks anyways.
Reply all
Reply to author
Forward
0 new messages