View Issue Details

IDProjectCategoryView StatusLast Update
0026029Open CASCADEOCCT:Visualizationpublic2015-05-14 16:35
ReportersanAssigned Toabv 
PriorityhighSeveritymajor 
Status closedResolutionfixed 
Target Version6.9.0Fixed in Version6.9.0 
Summary0026029: Visualization - Poor performance of connected objects
DescriptionThe 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 Reproducetest bugs vis bug26029
TagsNo tags attached.
Test case numberbugs vis(004) bug26029

Attached Files

  • OCCT_connected_bug.png (75,526 bytes)

Relationships

related to 0026220 closedbugmaster Visualization - In Graphic3d_Structure use single NCollection_IndexedMap instead of NCollection_DataMap and NCollection_Sequence 
related to 0026221 closedbugmaster Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_Layer to improve performance 

Activities

san

2015-04-07 18:14

developer  

OCCT_connected_bug.png (75,526 bytes)

git

2015-04-08 16:55

administrator   ~0039376

Branch CR26029 has been created by san.

SHA-1: 64ab05e619c381aca1b7b32edb924302d4eef7c0


Detailed log of new commits:

Author: san
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

git

2015-04-08 18:45

administrator   ~0039387

Branch CR26029 has been updated forcibly by san.

SHA-1: 66207ff8a298fe769730e424fa16d95cdc4eaded

git

2015-04-21 19:25

administrator   ~0040084

Branch CR26029_1 has been created by dbp.

SHA-1: c6ceef496e2b55d849ccd9e81fc17f8da89869ee


Detailed log of new commits:

Author: dbp
Date: Tue Apr 21 19:25:07 2015 +0300

    Initial

git

2015-04-22 12:05

administrator   ~0040095

Branch CR26029_2 has been created by dbp.

SHA-1: 4572ac970280e6d55291ffea92f7ad385c3bc139


Detailed log of new commits:

Author: dbp
Date: Wed Apr 22 11:15:49 2015 +0300

    0026029: Visualization - Poor performance of connected objects

dbp

2015-04-22 12:05

developer   ~0040096

Dear duv,

please review the patch in branch CR26029_2.

git

2015-04-24 12:03

administrator   ~0040200

Branch CR26029_3 has been created by dbp.

SHA-1: 26beb5aab8d323b4f699ea3e1d2692ef8a95705f


Detailed log of new commits:

Author: dbp
Date: Wed Apr 22 11:15:49 2015 +0300

    0026029: Visualization - Poor performance of connected objects

dbp

2015-04-24 12:03

developer   ~0040201

Dear kgv,

please review the patch in branch CR26029_3.

git

2015-04-30 15:53

administrator   ~0040488

Branch CR26029_3 has been updated forcibly by dbp.

SHA-1: 18a1f9762248905d483bc6938dc623ed53a5d591

san

2015-04-30 15:54

developer   ~0040489

Branch CR26029_3 reviewed without remarks, ready for testing.

apv

2015-05-06 12:42

tester   ~0040610

Dear BugMaster,

Branch CR26029_3 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 18a1f9762248905d483bc6938dc623ed53a5d591

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%]

git

2015-05-07 18:16

administrator   ~0040764

Branch CR26029_3 has been updated by dbp.

SHA-1: 284db874862f2fc297d524cece73e82dc1ccf152


Detailed log of new commits:

Author: dbp
Date: Thu May 7 18:16:07 2015 +0300

    Fix performance issue with SelectMgr_SelectableObjectSet.

git

2015-05-07 18:17

administrator   ~0040765

Branch CR26029_3 has been updated forcibly by dbp.

SHA-1: 1aab323be41edf2f1772d944c9c356e59247abb9

git

2015-05-14 16:34

administrator   ~0041070

Branch CR26029 has been deleted by inv.

SHA-1: 66207ff8a298fe769730e424fa16d95cdc4eaded

git

2015-05-14 16:35

administrator   ~0041071

Branch CR26029_1 has been deleted by inv.

SHA-1: c6ceef496e2b55d849ccd9e81fc17f8da89869ee

git

2015-05-14 16:35

administrator   ~0041072

Branch CR26029_2 has been deleted by inv.

SHA-1: 4572ac970280e6d55291ffea92f7ad385c3bc139

git

2015-05-14 16:35

administrator   ~0041073

Branch CR26029_3 has been deleted by inv.

SHA-1: 1aab323be41edf2f1772d944c9c356e59247abb9

Related Changesets

occt: master d4aaad5b

2015-05-07 15:20:27

abv


Committer: abv Details Diff
0026029: Visualization - Poor performance of connected objects

Fix performance issue with SelectMgr_SelectableObjectSet.
Affected Issues
0026029
mod - src/Graphic3d/FILES Diff File
mod - src/Graphic3d/Graphic3d.cdl Diff File
add - src/Graphic3d/Graphic3d_IndexedMapOfAddress.hxx Diff File
mod - src/Graphic3d/Graphic3d_Structure.cdl Diff File
mod - src/Graphic3d/Graphic3d_Structure.cxx Diff File
mod - src/OpenGl/OpenGl_Group.cxx Diff File
mod - src/OpenGl/OpenGl_Group.hxx Diff File
mod - src/OpenGl/OpenGl_SceneGeometry.cxx Diff File
mod - src/OpenGl/OpenGl_Structure.cxx Diff File
mod - src/OpenGl/OpenGl_Structure.hxx Diff File
mod - src/OpenGl/OpenGl_View.hxx Diff File
mod - src/OpenGl/OpenGl_View_Raytrace.cxx Diff File
mod - src/SelectMgr/SelectMgr_SelectableObjectSet.cxx Diff File
mod - src/SelectMgr/SelectMgr_SelectableObjectSet.hxx Diff File
mod - src/ViewerTest/ViewerTest_ObjectCommands.cxx Diff File
add - tests/bugs/vis/bug26029 Diff File

Issue History

Date Modified Username Field Change
2015-04-07 18:14 san New Issue
2015-04-07 18:14 san Assigned To => kgv
2015-04-07 18:14 san File Added: OCCT_connected_bug.png
2015-04-07 18:19 bugmaster Project Open CASCADE => Salome
2015-04-08 16:55 git Note Added: 0039376
2015-04-08 16:56 san Steps to Reproduce Updated
2015-04-08 17:06 bugmaster Project Salome => Open CASCADE
2015-04-08 18:45 git Note Added: 0039387
2015-04-10 09:28 kgv Assigned To kgv => isk
2015-04-10 09:28 kgv Status new => assigned
2015-04-21 19:25 git Note Added: 0040084
2015-04-22 12:05 git Note Added: 0040095
2015-04-22 12:05 dbp Note Added: 0040096
2015-04-22 12:05 dbp Assigned To isk => duv
2015-04-22 12:05 dbp Status assigned => resolved
2015-04-22 12:05 dbp Priority normal => high
2015-04-22 15:32 duv Assigned To duv => dbp
2015-04-22 15:32 duv Status resolved => assigned
2015-04-24 12:03 git Note Added: 0040200
2015-04-24 12:03 dbp Note Added: 0040201
2015-04-24 12:03 dbp Assigned To dbp => kgv
2015-04-24 12:03 dbp Status assigned => resolved
2015-04-27 15:16 kgv Assigned To kgv => san
2015-04-30 15:53 git Note Added: 0040488
2015-04-30 15:54 san Note Added: 0040489
2015-04-30 15:54 san Assigned To san => bugmaster
2015-04-30 15:54 san Status resolved => reviewed
2015-04-30 17:10 apv Assigned To bugmaster => apv
2015-05-06 11:10 apv Test case number => bugs vis(004) bug26029
2015-05-06 12:42 apv Note Added: 0040610
2015-05-06 12:42 apv Assigned To apv => dbp
2015-05-06 12:42 apv Status reviewed => assigned
2015-05-07 18:16 git Note Added: 0040764
2015-05-07 18:17 git Note Added: 0040765
2015-05-08 15:49 abv Changeset attached => occt master d4aaad5b
2015-05-08 15:49 abv Assigned To dbp => abv
2015-05-08 15:49 abv Status assigned => verified
2015-05-08 15:49 abv Resolution open => fixed
2015-05-13 18:48 dbp Relationship added related to 0026220
2015-05-13 18:49 dbp Relationship added related to 0026221
2015-05-14 15:28 aiv Status verified => closed
2015-05-14 15:30 aiv Fixed in Version => 6.9.0
2015-05-14 16:34 git Note Added: 0041070
2015-05-14 16:35 git Note Added: 0041071
2015-05-14 16:35 git Note Added: 0041072
2015-05-14 16:35 git Note Added: 0041073