First steps with the JavaFX Compiler

Thanks to the efforts of Robert Field, Lubo Litchev, and Jonathan Gibbons of the Javac team, as well as Per Bothner and Brian Goetz (and also thanks to the organizational efforts of Bob Brewin, James Gosling, and Tom Ball) we have the beginnings of a JavaFX to JVM-byte-code compiler built on the same infrastructure as Javac.

Of course, the compiler is still incomplete, but it turns out to be far enough along to try a first performance benchmark (Takeuchi function):

import java.lang.System;

public class Tak {
  operation tak(x:Number, y: Number, z:Number):Number;
}

operation Tak.tak(x, y, z) {
   return if (y >= x)
       then z
       else tak(tak(x-1, y, z),
                tak(y-1, z, x),
                tak(z-1, x, y));
}

var tak = new Tak();
System.out.println("tak(24,16,8)={tak.tak(24, 16, 8)}");

$ time java -cp ".;dist/JavaFX.jar" TakMod
tak(24,16,8)=9.0

real    0m1.333s
user    0m0.010s
sys     0m0.020s

Here's the interpreter:

$ time bin/javafx.sh TakMod.fx
compile thread: Thread[main,5,main]
compile 0.04
tak(24,16,8)=9.0
init: 69.48

real    1m10.422s
user    0m0.190s
sys     0m0.130s
Speed improvement for this particular example is a pretty awesome 54x.
Comments:

hi, sounds great! :) but how's compilation performance? is it faster than the current interpreter?

Posted by peter on July 14, 2007 at 12:18 PM PDT #

@Peter I'd say the answer to your question is something like "butterflies," which as an answer makes as much sense as your question.

Posted by Hans Uvstohn on July 15, 2007 at 01:48 AM PDT #

When can we download the compiler?

Posted by David Ford on July 15, 2007 at 04:42 AM PDT #

probably you misunderstood my question. the current javafx runtime needs a long time to check for syntax and semantical errors. so it would be great if this time will be shortened with the new compiler.

Posted by peter on July 17, 2007 at 03:48 AM PDT #

To Peter,
There is a figure for you.

JavaFX Interpreter (Class Loader) => Run-Time
JavaFX Compiler => Compiler-Time

Comparing compiler-time performance with run-time performance is meaningless.

Posted by Jerry Tsai on July 17, 2007 at 12:15 PM PDT #

again you misunderstood me. before the runtime (and I'm talking about the current javafx runtime without the upcoming compiler) can \*execute\* the application it has still to 'compile' the code before it can execute it. And I would like to have a comparison of exactly this time and the time the new compiler takes to compile.

Posted by peter on July 17, 2007 at 09:33 PM PDT #

So will Sun's heavy support of JavaFX finally lead to JVM support for tail recursion? That's the hope I just got while looking at this (though I'm not fresh on the details of proper tail recursion - not sure if this example applies - still, I understand that many functional folk are dying for it, and I understand why they want it).

Posted by Tom Palmer on July 19, 2007 at 05:33 AM PDT #

3

Posted by guest on July 19, 2007 at 05:33 AM PDT #

[Trackback] An incubator project to build a compiler for the JavaFX Script language has been started. Not much there yet, but developers have a chance to get in on the bottom floor and help make it a killer tool.

Posted by Tom Ball's Blog on July 19, 2007 at 11:50 PM PDT #

If I understand well, Peter is referring to the interactive experience while writing JavaFX code that is immediately executed. Right? So he's asking whether the time needed for compiling the stuff will have a negative impact on that experience.

Posted by Fabrizio Giudici on July 20, 2007 at 09:28 AM PDT #

This benchmark is just too naive.
At least loop it a 1000 times to give some meaningful results.
Currently you are mostly measuring pure VM startup times vs JavaFX startup times, taking absolutely no advantage of HotSpot at all.
You also should include the timings for a pure java implementation as reference.
I just checked a C implementation, at about 12s/1000 loops on a 2Ghz core2.

Posted by Eike Dierks on July 21, 2007 at 01:50 PM PDT #

is it possible to include external libraries in JavaFX applications ? how ?? I just can find Swing libraries and Java API libraries.. and how about third party libraries.. ?

Posted by Felipe Gaucho on July 21, 2007 at 08:42 PM PDT #

So will Sun's heavy support of JavaFX finally lead to JVM support for tail recursion? That's the hope I just got while looking at this (though I'm not fresh on the details of proper tail recursion - not sure if this example applies - still, I understand that many functional folk are dying for it, and I understand why they want it).

Posted by Warhammer Online Gold on March 11, 2009 at 03:03 PM PDT #

http://www.smsmatbaa.com

Posted by matbaa on June 22, 2009 at 03:05 AM PDT #

Nickel Metal Hydride batteries NiMH peuvent encore être trouvés un peu partout - en particulier pour les ordinateurs portables anciens modèles. La batterie ordianteur NiMH rechargeable portable était un grand pas en avant pour la technologie de bloc-notes pour la plupart en partie parce qu'ils étaient plus fiables que les piles NiCd, et ils avaient une puissance encore plus élevée. La batterie NiMH est également moins cher à produire, et plus sûrs à utiliser.

Posted by apple4 on August 12, 2010 at 08:42 PM PDT #

That's the hope I just got while looking at this (though I'm not fresh on the details of proper tail recursion - not sure if this example applies - still, I understand that many functional folk are dying for it, and I understand why they want it).

Posted by notebook akku on September 23, 2010 at 09:54 PM PDT #

the application it has still to 'compile' the code before it can execute it. And I would like to have a comparison of exactly this time and the time the new compiler takes to compile.

Posted by Batterie Ordinateur Portable on September 23, 2010 at 09:55 PM PDT #

La batterie ordianteur NiMH rechargeable portable était un grand pas en avant pour la technologie de bloc-notes pour la plupart en partie parce qu'ils étaient plus fiables que les piles NiCd, et ils avaient une puissance encore plus élevée. La batterie NiMH est également moins cher à produire, et plus sûrs à utiliser.

Posted by Batterie VGP-BPS8 on November 15, 2010 at 09:16 PM PST #

just checked a C implementation, at about 12s/1000 loops on a 2Ghz core2. , hi, sounds great! :)

Posted by Aspire 5810T on November 15, 2010 at 09:23 PM PST #

Simple and Nice example !

Posted by دردشة مصرية on December 04, 2010 at 07:59 PM PST #

Simple and Nice example !

Posted by دردشة on December 04, 2010 at 07:59 PM PST #

Simple and Nice example !

Posted by شات on December 04, 2010 at 08:00 PM PST #

Simple and Nice example !

Posted by شات مصرى on December 04, 2010 at 08:00 PM PST #

oh very nice. great work

Posted by Egitim on December 11, 2010 at 05:19 AM PST #

I've a season java programer, i miss..

Posted by chat on December 11, 2010 at 05:42 AM PST #

the application it has still to 'compile' the code before it can execute it.

Posted by شات on December 15, 2010 at 03:31 AM PST #

that sounds good, thank you very much

Posted by GS500 on December 23, 2010 at 03:48 PM PST #

Is it ok for all systems?

Posted by alice on January 20, 2011 at 10:46 AM PST #

Great, I will expect to see it, thanks!

Posted by Linda on March 01, 2011 at 01:45 PM PST #

Simple and Nice example !

Posted by خدماتك on March 04, 2011 at 07:16 PM PST #

Is it ok for all systems?

Posted by سعودى كول on March 04, 2011 at 07:16 PM PST #

Simple and Nice example !

Posted by سعودي توب on March 04, 2011 at 07:18 PM PST #

La batterie ordianteur NiMH rechargeable portable était un grand pas en avant pour la technologie de bloc-notes pour la plupart en partie parce qu'ils étaient plus fiables que les piles NiCd, et ils avaient une puissance encore plus élevée. La batterie NiMH est également moins cher à produire, et plus sûrs à utiliser.

Posted by عسلى on March 04, 2011 at 07:18 PM PST #

Speed improvement is very good with the Java FX

Posted by actron cp9580 on March 06, 2011 at 11:03 AM PST #

en partie parce qu'ils étaient plus fiables que les piles NiCd, et ils avaient une puissance encore plus élevée. La batterie NiMH est également moins cher à produire, et plus sûrs à utiliser.

Posted by sohu on March 20, 2011 at 11:28 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

user12610627

Search

Archives
« March 2015
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    
       
Today