Bug 1326

Summary: ArrayList usage that results in very slow removeChild calls
Product: Java3D Reporter: Phil Jordan <philjord>
Component: coreAssignee: Phil Jordan <philjord>
Severity: minor CC: gouessej
Priority: P4    
Version: 2.4.0   
Hardware: All   
OS: all   
Type: DEFECT SCM Refs:
Workaround: ---

Description Phil Jordan 2016-10-17 05:44:45 CEST
There is the use of ArrayList in a manner that is very slow when removals or clear are called.

NodeComponentRetained.users variable is slow when used in the methods

RenderBin.lockGeometryList and 
RenderBin.nodeComponentList variables are slow when used in the methods

My solution is two fold
1. To minimize the impact is to create a new class  that extends ArrayList<E> but internally stores the data in a LinkedHashSet, allowing faster get and remove performance
2. to alter the calls to utilize addAll and removeAll methods that are fast.

However this requires the addition of a new data class that may confuse users, a cleaner though having more impact solution would be to simply change the type from ArrayList to LinkedHashMap
Comment 1 Phil Jordan 2016-10-17 06:19:33 CEST
Also these slow arraylists are used here
and so that must be altered to accomadate any changes
Comment 2 Phil Jordan 2016-11-01 09:50:16 CET
resolved in 1.7.0