« Create Widgets in JavaFX with Newly-Released WidgetFX 1.0 | Main | JavaFX Pie Chart Demo: A Taste of Charts/Graphs Coming to the JFXtras Project »

January 07, 2009

Speeding up the JavaFX Presentation Cube for Jfokus

Stockholm-09-Horizontal

I'll be traveling to Stockholm in a few days to give a University session on JavaFX at Jfokus on January 27, 2009.  During that week on January 29-30 I'll also be teaching an intensive two-day class on creating JavaFX applications, with a focus on developing Rich Internet Applications.  In the past I've used a rotating cube developed in JavaFX to display static and dynamic (executing JavaFX code) content.

JFokus-pres-screenshot-small

The cube uses the PerspectiveTransform effect to do faux-3D, and was running at around 10 frames per second.  I asked Stephen Chin if he could tune it up a bit, and he sent me back a modified program that consistently achieves 60+ FPS on my dual core 2.4 GHz Vista machine.  In a later post Stephen and I will point out the optimization techniques used, but for now I wanted to give you a Java Web Start link to try it out: 

Webstartsmall2

To see the FPS that the cube is achieving on your machine, take a look at the Java console.  It also displays any acceleration type in use.  Here's my console output for reference:

Acceleration Type is: Direct3D
Animation FPS: 62
Animation FPS: 64
Animation FPS: 64
Animation FPS: 64
Animation FPS: 64
Animation FPS: 64
Animation FPS: 64
Animation FPS: 64
Animation FPS: 63
Animation FPS: 64

By the way, the presentation slides in the example that you'll be running are dated, but I'll post the actual Jfokus presentation cube on this blog for you shortly after the session.  Also, as I mentioned in yesterday's WidgetFX 1.0 post, I'll show you the code for this presentation cube as well as walking through how to tweak the code to convert it into a WidgetFX widget.

Enjoy,
Jim Weaver
JavaFXpert.com

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e54f133d698834010536ba79de970c

Listed below are links to weblogs that reference Speeding up the JavaFX Presentation Cube for Jfokus:

Comments

As an experiment one should take a page that uses a normal amount of ads from a popular site. Take the content and make simple placeholder JavaFX/Java applets and replace all the flash ads with those.

And then load the page and see what the difference really is.

A page like that should be made by Sun even, and they should make two versions, one that uses flash, and one that uses Java.

After that, just get the hands dirty optimizing the Java version till it's about as fast as the flash one.

Maybe there's too much prestige for Sun to do something like this publically, I don't know.

Regards, Tommy

- sorry for this not so nice comment but we have to face it -
Even today with 1.6 update 11, the startup time is still much longer than flash player. This is especially a problem when you program applets (can't the just change the horrible name...?) eather from java-Swing or javaFx perpective.

I think JavaFx and java Web service applets can still not be popular among developers with this slow startup.
Sun has to continue to put all of its energie with this dramatic issue.

I mean java 1.6 update 11 wath a "releaf update". It was necessary for javaFx release I think (or javaFx would have been just a joke comparing to Flash ot other rich client technology).

Now if Sun could give us a "wonderfully-fast-startup-jvm-like-Flash-does", perhaps the java client side java-Swing and java-javaFx could be successfull.
bur not before I believe. We hava to face it.
I decided yesterday to stop learning javaFx because of this.

Thierry

"I am running this on my Linux system and noticed that the drop down box in the lower left is cut by the border of the window, so I can only select the first item in the list. Is this a special problem on Linux?"

Carsten,
No, it's not unique to Linux. I moved the dropdown to the bottom and perhaps should have made it not so close to the bottom. I'll expand height of the Stage a bit.

Thanks,
Jim Weaver

Hi Jim,

I am running this on my Linux system and noticed that the drop down box in the lower left is cut by the border of the window, so I can only select the first item in the list.

Is this a special problem on Linux?

Acceleration Type is: CPU/SIMD
Animation FPS: 12
Animation FPS: 12
Animation FPS: 12

It definitely does need a faster CPU-based pipeline.

Acceleration Type is: Direct3D
Animation FPS: 70
Animation FPS: 73
Animation FPS: 73
Animation FPS: 73

CPU usage stays below 10%
My PC is a Vista machine with a Radeon HD3850
WidgetFX is still slow though

Looks like JavaFX needs a better software renderer for those who dont have a 3D acceleration card

Acceleration Type is: CPU/SIMD
Animation FPS: 18
Animation FPS: 17

On my fast Mac.

The Mac story is not that nice. I'll wait.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

My Photo

Upcoming Speaking Engagements:


  • Stephen Chin and Jim Weaver speaking about JavaFX Platform

  • Speaking on JavaFX and Java at Øredev in Malmö, Sweden on 2-6 November, 2009

Upcoming JavaFX Training:


  • Developing Secure, Rich Internet Applications Hosted on a Variety of Clients Using JavaFX Technology

Enter your email address:

Delivered by FeedBurner

Available now as early access eBook


  • Click book image above to obtain eBook

Twitter Updates

    follow me on Twitter

    Affiliations:

    DZone Links:


    July 2009

    Sun Mon Tue Wed Thu Fri Sat
          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  

    Disclaimer:

    • By reading this site, you are agreeing that under no circumstances will Veriana Networks, Inc. or its affiliates be responsible for (1) any information contained on or omitted from the site, (2) any person's reliance on any such information, whether or not the information is correct, current or complete, (3) the consequences of any action you or any other person takes or fails to take, whether or not based on information provided by or as a result of the use of the sites.