JDK-8118785 : 8.0-controls-scrum-569: 42% performance regression in Controls.ListView-Keyboard
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-05-10
  • Updated: 2015-06-17
  • Resolved: 2013-06-06
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
Duplicate :  
Description
There is -42% (-53 fps) Controls.ListView-Keyboard performance regression in build 8.0-controls-scrum-569.
This build contains only one change (according to Hudson):
 
1. RT-19435: follow styleable parent chain to find parent stylesheets and inline styles.


According to JPA profiles there is significant increase of time spent in
 javafx.collections.WeakSetChangeListener.onChange(...)
 
 
The time spent in GC also increased from 1.2 sec to 4.9 sec (total exec time is 30 sec).

Steps to run Controls.ListView-Keyboard:
> cd JFX_WS/tests/performance/Controls/
> ant
> java -Djavafx.animation.fullspeed=true
       -cp "JFX_HOME/rt/lib/ext/jfxrt.jar;./dist/Controls.jar;../FXBenchmark/dist/FXBenchmark.jar;../../../import/benchmarks-2.1.1/benchmarks-2.1.1.jar"
       jrockit.bm.Main controls.bm.ListViewBenchmark -i 1 -wt 0 -tr 60 -cells 10000 -mode keyboard -keysPerInjection 100

Comments
verified in b97
19-07-2013

Fixed by RT-30976. Changeset is http://hg.openjdk.java.net/openjfx/8/controls/rt/rev/479da853570b
06-06-2013

UnmodifiableObservableSet adds a listener to the backingSet even though there may never be a listener added to the backing set. This is the root cause of this regression. public UnmodifiableObservableSet(ObservableSet<E> backingSet) { this.backingSet = backingSet; listener = new SetChangeListener<E>() { @Override public void onChanged(Change<? extends E> c) { callObservers(new SetAdapterChange<E>(UnmodifiableObservableSet.this, c)); } }; this.backingSet.addListener(new WeakSetChangeListener<E>(listener)); } Sent email to Martin to see if the listener instantiation and add to backingSet could be made lazy.
05-06-2013

The regression on Linux x86 is even bigger, it is ~90%: 568: 221 fps 569: 21 fps
04-06-2013

Finally it is called from ListViewBehavior.selectNextRow and ListViewBehavior.selectPreviousRow. Here are two examples of stack traces +- 4.491 (75%) com.sun.javafx.scene.control.behavior.ListViewBehavior.selectNextRow() | +- 4.237 (70%) com.sun.javafx.scene.control.skin.ListViewSkin$10.run() | | +- 4.237 (70%) com.sun.javafx.scene.control.skin.ListViewSkin.access$700(com.sun.javafx.scene.control.skin.ListViewSkin) | | +- 4.237 (70%) com.sun.javafx.scene.control.skin.ListViewSkin.onSelectNextCell() | | +- 4.237 (70%) com.sun.javafx.scene.control.skin.VirtualFlow.show(int) | | +- 3.800 (63%) com.sun.javafx.scene.control.skin.VirtualFlow.show(javafx.scene.control.IndexedCell) | | | +- 3.800 (63%) com.sun.javafx.scene.control.skin.VirtualFlow.adjustPixels(double) | | | +- 2.385 (40%) com.sun.javafx.scene.control.skin.VirtualFlow.getCellLength(int) | | | | +- 1.452 (24%) com.sun.javafx.scene.control.skin.VirtualFlow.releaseCell(javafx.scene.control.IndexedCell) | | | | | +- 1.452 (24%) javafx.scene.control.IndexedCell.updateIndex(int) | | | | | +- 0.952 (16%) javafx.scene.control.ListCell.indexChanged() | | | | | | +- 0.952 (16%) javafx.scene.control.ListCell.updateItem() | | | | | | +- 0.952 (16%) com.sun.javafx.scene.control.skin.ListViewSkin$12.updateItem(java.lang.Object, boolean) | | | | | | +- 0.952 (16%) javafx.scene.control.Cell.updateItem(java.lang.Object, boolean) | | | | | | +- 0.952 (16%) javafx.scene.control.Cell.setEmpty(boolean) | | | | | | +- 0.952 (16%) javafx.beans.property.BooleanPropertyBase.set(boolean) | | | | | | +- 0.952 (16%) javafx.beans.property.BooleanPropertyBase.markInvalid() | | | | | | +- 0.952 (16%) javafx.scene.control.Cell$2.invalidated() | | | | | | +- 0.952 (16%) javafx.scene.Node.pseudoClassStateChanged(javafx.css.PseudoClass, boolean) | | | | | | +- 0.479 (8%) com.sun.javafx.css.BitSet.add(java.lang.Object) | | | | | | | +- 0.479 (8%) com.sun.javafx.css.BitSet.notifyObservers(java.lang.Object, boolean) | | | | | | | +- 0.479 (8%) com.sun.javafx.collections.SetListenerHelper.fireValueChangedEvent(com.sun.javafx.collections.SetListenerHelper, ...) | | | | | | | +- 0.479 (8%) com.sun.javafx.collections.SetListenerHelper$Generic.fireValueChangedEvent(javafx.collections.SetChangeListener$Change) | | | | | | | +- 0.479 (8%) javafx.collections.WeakSetChangeListener.onChanged(javafx.collections.SetChangeListener$Change) | | | | | | +- 0.473 (8%) com.sun.javafx.css.PseudoClassState.remove(java.lang.Object) | | | | | | +- 0.473 (8%) com.sun.javafx.css.BitSet.remove(java.lang.Object) | | | | | | +- 0.473 (8%) com.sun.javafx.css.BitSet.notifyObservers(java.lang.Object, boolean) | | | | | | +- 0.473 (8%) com.sun.javafx.collections.SetListenerHelper.fireValueChangedEvent(com.sun.javafx.collections.SetListenerHelper, ...) | | | | | | +- 0.473 (8%) com.sun.javafx.collections.SetListenerHelper$Generic.fireValueChangedEvent(javafx.collections.SetChangeListener$Change) | | | | | | +- 0.473 (8%) javafx.collections.WeakSetChangeListener.onChanged(javafx.collections.SetChangeListener$Change) | | | | | +- 0.499 (8%) javafx.beans.property.IntegerPropertyBase.set(int) | | | | +- 0.933 (15%) com.sun.javafx.scene.control.skin.VirtualFlow.getCell(int) | | | +- 1.413 (23%) com.sun.javafx.scene.control.skin.VirtualFlow.addLeadingCells(int, double) | | | +- 9.63E-4 (0%) com.sun.javafx.scene.control.skin.VirtualFlow.adjustByPixelAmount(double) | | +- 0.437 (7%) com.sun.javafx.scene.control.skin.VirtualFlow.setCellIndex(javafx.scene.control.IndexedCell, int) | +- 0.253 (4%) javafx.scene.control.MultipleSelectionModelBase.clearAndSelect(int) +- 1.522 (25%) com.sun.javafx.scene.control.behavior.ListViewBehavior.selectPreviousRow()
16-05-2013

Can you tell from JPA who is calling onChange?
16-05-2013

Yes, the time spent in javafx.collections.WeakSetChangeListener.onChange is pretty much the same. JPA profiles for builds 569 and 578 look similar.
15-05-2013

Does JPA still show javafx.collections.WeakSetChangeListener.onChange?
14-05-2013

the regression is not fixed
14-05-2013

RT-30358 has been integrated into build 8.0-controls-scrum-578. However, there are no ListView performance improvements seen build 8.0-controls-scrum-578. The regression still exist. See Controls results for builds 569, 577, 578 in Aurora: http://aurora.ru.oracle.com/performance/faces/ChessBoard.xhtml?reportName=FX2-controls-scrum&parameters=%5BlatestBuild%5D21578%5BprevBuild%5D21568%5Bshownbenchmarks%5D%281%3D1%29%5Bhwclass%5DWin7-High-Range%5Brefrelease%5D8.0%5Brefbuild%5D21568%5Brefjdkrelease%5D%281%3D1%29%5Brelease%5D8.0%5Bbuild%5D21569%2C21577%2C21578%5Bjdkrelease%5D%281%3D1%29&splitting=%5BX+axis%5DfxConf%2C+metricName%5BComplement%5Dbenchmark%2C+os%2C+jdkBuild%2C+jdk%5BY+axis%5DbenchmarkName%2C+benchmarkConf%2C+fxRelease%2C+fxBuild%5BZ+axis%5Dhwclass%2C+benchmarkSuite%2C+jdkRelease&reference=%5BOthers%5DfxRelease%2C+fxBuild%2C+os%2C+jdkRelease%2C+jdkBuild%2C+jdk%2C+benchmarkSuite%2C+benchmarkName%2C+metricName%5BReference+Set%5Dbenchmark%2C+benchmarkConf%2C+fxConf%2C+hwclass&mixReference=false&flags=&significance=empty&hideDataConfiguration=false&calculateSummary=false&showSummaryExpanded=false&showSummaryContents=true&showComplementAttributes=false&compactTables=true&viewStyle=chessboard&filter=&filter_override=
14-05-2013

Similar regression happened on Embedded as well: -48%, ListView-Keyboard -5%, TableView-Keyboard -5%, TableView-Mouse -6%, TreeView-Expand.items1000-depth
14-05-2013