JDK-8100879 : Performance degrades in case window size is increased but the dirty area remains the same
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2011-08-02
  • Updated: 2015-06-16
  • Resolved: 2012-11-02
Related Reports
Blocks :  
Duplicate :  
Duplicate :  
Description
FX performance changes significantly in case window size is increased even in case
dirty area remains the same. For example running Controls.Checkbox benchmark in the mode
where we press only on one check box during the pulse shows the following performance results:
  400x300 => 31 fps
  800x600 => 11.5 fps
 1400x1200 => 5.8 fps

Note, I run the test with -Dprism.showdirty which shows the the dirty area is always the same.

JavaPerformance analyzer shows that we spend almost same time in com.sun.prism.d3d.D3DResourceFactory.nUpdateTextureB()
for all window sizes. But the rendering time of one pulse is increased.
I have instrumented prism-d3d/src/com/sun/prism/d3d/D3DTexture.java to see if there is a difference in how nUpdateTextureB 
is called and here is what I found:
 400x300: nUpdateTextureB is called 19,212 times, buffer size is always 4096
1400x1200: nUpdateTextureB is called 44,952 times, buffer size is always 4096

So, in case of bigger window size we call nUpdateTextureB more often as few buffers/Textures are required to present the window.
As I understand this means we always copy whole window even in case only part of it has been modified.
Perhaps it could be optimized.

How to run the test:
> cd jfx/tests/performance/Controls
> ant build
> java -cp "JFX/rt/lib/jfxrt.jar;./../FXBenchmark/dist/FXBenchmark.jar;../../import/benchmarks-2.1.1/benchmarks-2.1.1.jar;./dist/Controls.jar" 
  jrockit.bm.Main controls.bm.CheckboxBenchmark -i 1 -wt 5 -tr 10 -togglestep 1