<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1326</bug_id>
          
          <creation_ts>2016-10-17 05:44:45 +0200</creation_ts>
          <short_desc>ArrayList usage that results in very slow removeChild calls</short_desc>
          <delta_ts>2019-03-29 14:19:17 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>General</classification>
          <product>Java3D</product>
          <component>core</component>
          <version>2.4.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Phil Jordan">p.j.nz</reporter>
          <assigned_to name="Phil Jordan">p.j.nz</assigned_to>
          <cc>gouessej</cc>
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>5955</commentid>
    <comment_count>0</comment_count>
    <who name="Phil Jordan">p.j.nz</who>
    <bug_when>2016-10-17 05:44:45 +0200</bug_when>
    <thetext>There is the use of ArrayList in a manner that is very slow when removals or clear are called.

Specifically:
NodeComponentRetained.users variable is slow when used in the methods
copyMirrorUsers
removeMirrorUsers
removeUser


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


My solution is two fold
1. To minimize the impact is to create a new class  that extends ArrayList&lt;E&gt; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5958</commentid>
    <comment_count>1</comment_count>
    <who name="Phil Jordan">p.j.nz</who>
    <bug_when>2016-10-17 06:19:33 +0200</bug_when>
    <thetext>Also these slow arraylists are used here
Shape3DRetained.getGeomAtomsList 
and so that must be altered to accomadate any changes</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5980</commentid>
    <comment_count>2</comment_count>
    <who name="Phil Jordan">p.j.nz</who>
    <bug_when>2016-11-01 09:50:16 +0100</bug_when>
    <thetext>resolved in 1.7.0</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>