JDK-8125851 : 8.0-graphics-scrum-h458: more than 50% regression in Controls.TextField benchmark
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-12-18
  • Updated: 2015-06-17
  • Resolved: 2012-12-18
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 8
8Fixed
Related Reports
Relates :  
Description
There are following regressions observed in build 8.0-graphics-scrum-h458 in Controls.TextField.kb-text100k:
  WinXP: -54% (-543 fps)
 MacMid: -65% (-565 fps)

8.0-graphics-scrum-h458 contains the following fixes:
    1. RT-23074: Support bi-directional text in controls + RT-23075: Support complex characters in controls ��� leifs / detail
    2. Fix junit (RT-21683) ��� Felipe Heidrich / detail
    3. RT-26751: Enhance JavaFX launcher to allow Java launcher to directly launch JavaFX application jars ��� ddehaven / detail
    4. Fixed bad apostrophe in doc comment. ��� rbair / detail


Looks like the regression is caused by first change. 


I ran TextField benchmark for 40 seconds and collected JPA profile.
Java profile shows that almost 87% of time (35.5 seconds) is now spent
in java.text.Bidi.<init> and in particular in sun.text.bidi.BidiBase.getDirProps().
Here is the stack trace:
+-  36.228   (88%)    com.sun.javafx.scene.control.behavior.TextInputControlBehavior.callAction(java.lang.String)
|  +-  36.175   (88%)    com.sun.javafx.scene.control.behavior.TextInputControlBehavior.nextCharacterVisually(boolean) 
|  |  +-  35.588   (87%)    com.sun.javafx.scene.control.behavior.TextInputControlBehavior.getBidi()
|  |  |  +-  35.580   (87%)    java.text.Bidi.<init>(java.lang.String, int)
|  |  |  |  +-  33.732   (82%)    sun.text.bidi.BidiBase.<init>(char[], int, byte[], int, int, int)
|  |  |  |  |  +-  33.726   (82%)    sun.text.bidi.BidiBase.setPara(char[], byte, byte[])
|  |  |  |  |  |  +-  33.597   (82%)    sun.text.bidi.BidiBase.getDirProps()
|  |  |  |  |  |  |  +-  6.911   (17%)    sun.text.normalizer.UBiDiProps.getClass(int)
|  |  |  |  |  |  |  +-  3.724   (9%)    sun.text.normalizer.UTF16.charAt(char[], int, int, int)



Steps to run the benchmark:
> cd JFX_WS/tests/performance/Controls/
> ant
> java -Djavafx.animation.fullspeed=true
       -cp "JFX_HOME/rt/lib/jfxrt.jar;./dist/Controls.jar;../FXBenchmark/dist/FXBenchmark.jar;../../../import/benchmarks-2.1.1/benchmarks-2.1.1.jar"
       jrockit.bm.Main controls.bm.TextFieldBenchmark -i 1 -wt 0 -tr 30 -test fixedtext -textlen 100000 -debug false



Comments
verified in build 8.0-graphics-scrum-h464, the fix is part of promoted builds as well
19-07-2013

Changeset: http://hg.openjdk.java.net/openjfx/8/graphics/rt/rev/6696e9cea59c This adds caching to the Bidi object and its retrieved properties. Any remaining performance regression is probably necessary for this new feature.
18-12-2012