JDK-8120086 : Node clip animation consumes a lot of CPU time when running inside JFXPanel
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 7u6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2012-05-25
  • Updated: 2015-06-17
  • Resolved: 2012-06-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7u6Resolved
Related Reports
Blocks :  
Relates :  
Description
On my quad core Windows laptop, the attached sample application consumes around 5% of available CPU time when launched as a "native" JavaFX application, and around 25% of available CPU time (that is, an entire CPU core), when launched inside a JFXPanel.

I guess this has to do with non-rectangular clips being used by the application.

To run the sample application inside a JFXPanel, launch it with the "embed" command line argument.

The problem seems to be related to PERF-311 and RT-21740. However, the problem is not Mac specific and is reproducible on Windows, and profiling shows that D3DRTTexture.readPixels is not the main CPU consumer in this case.

The problem affects WebView performance inside NetBeans, see RT-21629.
Comments
It turns out even trivial JavaFX animation consumes an entire CPU core when running inside JFXPanel, see PERF-326. I am therefore closing this issue for now.
13-06-2012

This behavior is expected. JavaFX uses a D3D device to render. Java2d also uses D3D, but an another device. The rendering is being done in parallel: a JavaFX rendering thread renders an image to a texture and read the result. At the same time java2d renders the image on a different thread using a different D3D device. So that CPU load is increased. Additional time is spent to transfer rendering results from the JavaFX D3DDevice to the Java2D D3D device. Almost the same is done with GL, where different contexts in GL has the same concept as D3D devices.
13-06-2012

Still observing the problem now after RT-21740 is fixed.
09-06-2012

Raising priority to Critical as it heavily affects JFXPanel performance running in NetBeans.
07-06-2012

Assign to Kirill to evaluate.
29-05-2012