DiscussionsIssue archiveOCCT:Visualization

Archived issue #0026029

Visualization - Poor performance of connected objects

Open CASCADEOCCT:Visualizationclosed16 public notes

Search issues

Description

The following simple scenario discovers N-square performance problem in the OCCT connected objects mechanism:

  • 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.

01Commenter 2
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
02Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
03Commenter 2
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
04Commenter 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
05Commenter 5
Dear duv,

please review the patch in branch CR26029_2.
06Commenter 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
07Commenter 7
Dear kgv,

please review the patch in branch CR26029_3.
08Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
09Commenter 9
Branch CR26029_3 reviewed without remarks, ready for testing.
10Commenter 10
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%]
11Commenter 2
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.

12Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
13Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
14Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
15Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
16Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records