Archived issue #0026029
Visualization - Poor performance of connected objects
Description
The following simple scenario discovers N-square performance problem in the OCCT connected objects mechanism:
Quick profiling shows two major hotspots (see the attached screenshot):
These two methods iterate through the ancestor/descendants lists that is extremely inefficient in case of more or less large number of children in the connected objects graph.
Thus their design should be optimized to support large number of children with just subcritical performance overhead. Else the whole connected objects mechanism is useless.
DRAW reproducer coming soon (vconnectto command currently lacks -noupdate argument).
- Display a TopoDS_Shape (e.g. a sphere) using an AIS_Shape instance.
- Create 40000 AIS_ConnectedInteractive objects connected to the source AIS_Shape and translated by some vector and measure time spent in AIS_InteractiveContext::Display() for these objects
- Repeat the same steps but with 90000 AIS_ConnectedInteractive objects
Quick profiling shows two major hotspots (see the attached screenshot):
- Graphic3d_Structure::Connect() - 35.5% of time
- OpenGl_Structure::RegisterAncestorStructure() - 45.3% of time
These two methods iterate through the ancestor/descendants lists that is extremely inefficient in case of more or less large number of children in the connected objects graph.
Thus their design should be optimized to support large number of children with just subcritical performance overhead. Else the whole connected objects mechanism is useless.
DRAW reproducer coming soon (vconnectto command currently lacks -noupdate argument).
Steps to reproduce
test bugs vis bug26029
Public activity
16 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Wed Apr 8 16:55:18 2015 +0300
0026029: Visualization - Poor performance of connected objects
vconnectto command improved to provide a DRAW reproducer
Test case added
[revision removed]
Detailed log of new commits:
Author: Author
Date: Wed Apr 8 16:55:18 2015 +0300
0026029: Visualization - Poor performance of connected objects
vconnectto command improved to provide a DRAW reproducer
Test case added
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: dbp
Date: Tue Apr 21 19:25:07 2015 +0300
Initial
[revision removed]
Detailed log of new commits:
Author: dbp
Date: Tue Apr 21 19:25:07 2015 +0300
Initial
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: dbp
Date: Wed Apr 22 11:15:49 2015 +0300
0026029: Visualization - Poor performance of connected objects
[revision removed]
Detailed log of new commits:
Author: dbp
Date: Wed Apr 22 11:15:49 2015 +0300
0026029: Visualization - Poor performance of connected objects
Dear duv,
please review the patch in branch CR26029_2.
please review the patch in branch CR26029_2.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: dbp
Date: Wed Apr 22 11:15:49 2015 +0300
0026029: Visualization - Poor performance of connected objects
[revision removed]
Detailed log of new commits:
Author: dbp
Date: Wed Apr 22 11:15:49 2015 +0300
0026029: Visualization - Poor performance of connected objects
Dear kgv,
please review the patch in branch CR26029_3.
please review the patch in branch CR26029_3.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch CR26029_3 reviewed without remarks, ready for testing.
Dear Commenter 1,
Branch CR26029_3 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component:
Linux: 18 (18 on master)
Windows: 0 (0 on master)
products component:
Linux: 4 (4 on master)
Windows: 0 (0 on master)
Regressions/Differences:
Not detected
Testing cases:
bugs vis(004) bug26029 - FAILED
http://occt-tests/CR26029-3-master-occt-64/Debian60-64/bugs/vis/bug26029.html
http://occt-tests/CR26029-3-master-occt-64/Windows-64-VC10/bugs/vis/bug26029.html
Testing on Linux:
Total MEMORY difference: 94789946 / 94582691 [+0.22%]
Total CPU difference: 56151.56999999983 / 51016.90999999946 [+10.06%]
Testing on Windows:
Total MEMORY difference: 57260586 / 57268356 [-0.01%]
Total CPU difference: 15840.996744198907 / 15811.184953098971 [+0.19%]
Branch CR26029_3 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component:
Linux: 18 (18 on master)
Windows: 0 (0 on master)
products component:
Linux: 4 (4 on master)
Windows: 0 (0 on master)
Regressions/Differences:
Not detected
Testing cases:
bugs vis(004) bug26029 - FAILED
http://occt-tests/CR26029-3-master-occt-64/Debian60-64/bugs/vis/bug26029.html
http://occt-tests/CR26029-3-master-occt-64/Windows-64-VC10/bugs/vis/bug26029.html
Testing on Linux:
Total MEMORY difference: 94789946 / 94582691 [+0.22%]
Total CPU difference: 56151.56999999983 / 51016.90999999946 [+10.06%]
Testing on Windows:
Total MEMORY difference: 57260586 / 57268356 [-0.01%]
Total CPU difference: 15840.996744198907 / 15811.184953098971 [+0.19%]
Branch [archived branch] has been updated by Participant.
[revision removed]
Detailed log of new commits:
Author: dbp
Date: Thu May 7 18:16:07 2015 +0300
Fix performance issue with SelectMgr_SelectableObjectSet.
[revision removed]
Detailed log of new commits:
Author: dbp
Date: Thu May 7 18:16:07 2015 +0300
Fix performance issue with SelectMgr_SelectableObjectSet.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Related records
- #0026220 · related to · closedVisualization - In Graphic3d_Structure use single NCollection_IndexedMap instead of NCollection_DataMap and NCollection_Sequence
- #0026221 · related to · closedVisualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_Layer to improve performance