Chris Oliver's Weblog
- All
- F3
- JavaFX
- Programming
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.130sSpeed improvement for this particular example is a pretty awesome 54x.
Posted at 03:25PM Jul 14, 2007 by Christopher Oliver in JavaFX | Comments[13]
Posted by peter on July 14, 2007 at 07:18 PM PDT #
Posted by Hans Uvstohn on July 15, 2007 at 08:48 AM PDT #
Posted by David Ford on July 15, 2007 at 11:42 AM PDT #
Posted by peter on July 17, 2007 at 10:48 AM PDT #
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 07:15 PM PDT #
Posted by peter on July 18, 2007 at 04:33 AM PDT #
Posted by Tom Palmer on July 19, 2007 at 12:33 PM PDT #
Posted by 61.8.226.148 on July 19, 2007 at 12:33 PM PDT #
Posted by Tom Ball's Blog on July 20, 2007 at 06:50 AM PDT #
Posted by Fabrizio Giudici on July 20, 2007 at 04:28 PM PDT #
That's great to hear. I am really looking forward to JavaFX Script's release, and some visual design tools to be used along side a code editor.
I've read most of the tutorials and had a couple of questions:
1) One of JavaFX Script's uses marketed at JavaOne was for RIA development, competing with Adobe Flex. I would imagine most of the app would be written in JavaFX and run client-side. How will it access EJBs, web services, databases, etc?
2) Will there one day be a visual designer such as NetBeans' Matisse and Adobe Flex Builder for designing screens? I realize that JavaFX script is supposed to simplify Swing development but I still prefer to use a visual designer for initial screen design rather than typing code and setting properties manually.
3) The JSF guys talk about how the renderer doesn't have to be HTML and could be anything. Is there a way for JavaFX Script RIAs to take advantage of JSF's features? I can't really see how, but you may know.
Thanks,Ryan
Posted by Ryan de Laplante on July 20, 2007 at 04:58 PM PDT #
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 08:50 PM PDT #
Posted by Felipe Gaucho on July 22, 2007 at 03:42 AM PDT #