Skip to main content

Performance issues with javafx.scene.Node and subclasses in JDK8

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2013-10-10

I hope this is the right forum to reach the devs. If it isn't, please point me towards where I should direct my feedback.

We are attempting to use JavaFX to visualize integrated circuits, i.e. computer chips. Those designs can easily consist of millions of little pieces of material, as this is how the only data format that all design tools know works. We are currently trying to use the primitive 3D shapes that are in the JDK (they can be used to represent the geometry in the dataset very easily) but we have run into the following problems:

* The Node objects seems to be very big and it's setTranslateX() method (and the equivalent for Y and Z) has a pretty hefty runtime cost. I identified especially the step that invalidates the Property as taking a surprising amount of time. There doesn't seem to be a way to apply one translation action on all three axes. I read in an old message to the developer mailing list that the Node object for both 2D and 3D is here to stay, so this is a big issue when trying to do more complex 3D. A constructor that allows for the coordinates to be set right at instantiation

* The javafx.scene.shape.Box object's setHeight() method ( also takes quite some time to finish, making the instantiation or manipulation of a simple Box much more costly than a Sphere, because a sphere only needs one method to set it's radius. Unless I misunderstand it, this shouldn't be the case, as a cube should be a less complex shape than a sphere. Again, having one method to define the new shape in one go might be helpful.

* When the Camera object is moved, one would expect that it and only it must move but apperently a huge number of 3d transformations are done "under the hood". Is this working as intended? This is a huge performance hit, although it has gotten better lately.

If those issues can actually be mitigated by doing something we haven't figured out yet, I would also appreciate it very much to hear about solutions.

(Sorry for my bad english.)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-07-24

The forums here are monitored sporadically. Please bring up such discussions on Oracle forums or OpenJDK mailing lists, or simply file bugs/RFEs against corresponding products.

IIRC, this specific issue has been discussed on the mailing list a few months ago, and it was concluded that FX Nodes aren't suitable for CAD applications with millions of objects to display. It was suggested to manage such objects using custom classes in your own application (i.e. w/o inheriting from Node) and render all the CAD graphics using a Canvas. Please search the mailing list archives to find the relevant thread.