View Issue Details

IDProjectCategoryView StatusLast Update
0026139CommunityOCCT:Visualizationpublic2016-06-25 16:11
Reportersolomin_s Assigned Toabv  
PrioritynormalSeveritymajor 
Status closedResolutionfixed 
PlatformLixuxOSUbuntu 
Product Version6.9.0 
Target Version6.9.0Fixed in Version6.9.0 
Summary0026139: AIS_InteractiveContext::Display performance regression
DescriptionDisplaying AIS_IO now requires more time than earlier. AIS_InteractiveContext::Display spends 95% of time to add AIS_IO to selection manager, 75% of which is spent to find element in NCollection_BaseSequence [see attachments]. NCollection_BaseSequence usage seems to be ineffective to store objects and indexes in SelectMgr_SensitiveEntitySet, because it has a lot of access operations.
Steps To Reproducetest bugs vis bug26139
Additional information
and documentation updates
http://dev.opencascade.org/index.php?q=node/1079
TagsNo tags attached.
Test case number

Attached Files

  • Screenshot from 2015-04-23 19:53:18.png (38,457 bytes)
  • Screenshot from 2015-04-23 19:55:18.png (41,038 bytes)
  • times1.png (118,095 bytes)
  • Draw_RL_Extern_NXSpeedBoat.png (28,480 bytes)
  • Draw_RL_Extern_NXSpeedBoat+deque.png (98,823 bytes)
  • reproducer.tcl (82 bytes)
  • Big_Model_Times.png (85,294 bytes)
  • Big_Model_Times_deque.png (48,329 bytes)

Relationships

related to 0024623 closedbugmaster Open CASCADE Visualization - improve selection mechanism 
related to 0026199 closedbugmaster Open CASCADE Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_BVHClipPrimitiveSet to improve performance 
related to 0026195 closedbugmaster Open CASCADE Visualization - optimize selection algorithms 
related to 0026626 closedbugmaster Community occ 6.9.0 performance loss 

Activities

solomin_s

2015-04-24 12:12

developer  

Screenshot from 2015-04-23 19:53:18.png (38,457 bytes)

solomin_s

2015-04-24 12:13

developer  

Screenshot from 2015-04-23 19:55:18.png (41,038 bytes)

solomin_s

2015-04-24 12:13

developer  

times1.png (118,095 bytes)

solomin_s

2015-04-24 12:17

developer   ~0040202

Replacing NCollection_BaseSequence with std::deque the hotspot has gone and AIS_InteractiveContext::Display has sped up by 2.5x.

git

2015-04-24 23:29

administrator   ~0040247

Branch CR26139 has been created by solomin_s.

SHA-1: 7ca81119e46b375d9bc8adf9130efefc48b0a0d9


Detailed log of new commits:

Author: Sergey Solomin
Date: Fri Apr 24 23:18:06 2015 +0300

    0026139: AIS_InteractiveContext::Display performance regression
    
    Replacing NCollection_BaseSequence with std::deque

solomin_s

2015-04-24 23:32

developer   ~0040248

I've published my changes which give 2.5x speed-up displaying my model.

abv

2015-04-25 07:13

manager   ~0040249

Last edited: 2015-04-25 07:15

I believe the class SelectMgr_SensitiveSet and around must be refactored:

- there is no sense in maintaining myEntityIdxs sequence, it does not bring anything apart of extra indirection. To sort the objects, you can instead swap them directly in their own container, so that index is always direct.

- vector can be used instead of sequence or deque. When removing element from the set, for efficiency it can be first swapped with the last one, then the last removed

- in Swap(), use std::swap()

- class BVH_Set lacks documentation: at a minimum, it must be indicated whether the index is assumed to be 0- or 1-based. Then, I suppose it should be clearly indicated that its entities are going to be re-sorted regularly (this would be a hint to use data structures with fast random access rather than sequences in implementation of descendants). Even description of template arguments T and N is very vague. If I get it right, T is data type to be used for each coordinate (either double or float), and N is dimension of the space (must be either 2 or 3). The same applies to most of the classes in BVH.

git

2015-04-28 10:27

administrator   ~0040315

Branch CR26139_1 has been created by vpa.

SHA-1: 8a0a41d20f1835cf5bcaaa8600ff14280e6d47dd


Detailed log of new commits:

Author: vpa
Date: Tue Apr 28 01:56:35 2015 +0300

    Refactoring of SelectMgr_SensitiveEntitySet

git

2015-05-06 20:49

administrator   ~0040681

Branch CR26139_1 has been updated by vpa.

SHA-1: 7e72082669b1d412e77c2f3334d70c0535767488


Detailed log of new commits:

Author: vpa
Date: Wed May 6 20:49:42 2015 +0300

    Fixed warnings

git

2015-05-06 21:18

administrator   ~0040687

Branch CR26139_1 has been updated by vpa.

SHA-1: d48745b74e2d1e3002b5266bed67b76cb7818d40


Detailed log of new commits:

Author: vpa
Date: Wed May 6 21:18:43 2015 +0300

    Test case for issue 0026139

git

2015-05-06 21:19

administrator   ~0040688

Branch CR26139_2 has been created by vpa.

SHA-1: 410f65035e52918222d09d0d1a2b2f4459b30d61


Detailed log of new commits:

Author: vpa
Date: Wed May 6 21:19:35 2015 +0300

    0026139: AIS_InteractiveContext::Display performance regression
    
    NCollection_Sequence in SelectMgr_SensitiveEntitySet was replaced by data map and vector to provide fast access for BVH

vpa

2015-05-06 21:20

developer   ~0040689

Dear Anton,

please review patch from branch CR26139_2.

apl

2015-05-06 21:23

developer   ~0040690

Last edited: 2015-05-06 21:24

Dear Mikhail,

Reviewed. Please test.

bugmaster

2015-05-07 07:42

administrator   ~0040691

Problem compilation on Windows and Linux platforms

http://jenkins-test-01.nnov.opencascade.com:8080/view/CR26139-2-master/job/CR26139-2-master_build_occt_windows_64/

http://jenkins-test-01.nnov.opencascade.com:8080/view/CR26139-2-master/job/CR26139-2-master_build_occt_linux/1/parsed_console/

git

2015-05-07 10:24

administrator   ~0040697

Branch CR26139_2 has been updated by abv.

SHA-1: d616bf67764278591e2f3da3768a13c393e58f9b


Detailed log of new commits:

Author: abv
Date: Thu May 7 10:23:53 2015 +0300

    Minor correction

abv

2015-05-07 10:24

manager   ~0040698

Correction pushed to CR26139_2, please re-test

apv

2015-05-07 14:32

tester   ~0040735

Dear Varvara,

There are a lot of regressions detected on Linux during testing of CR26139. Full report will be posted after testing on Windows.
More information about testing on Linux could be found by the following link:
http://occt-tests/CR26139-2-master-occt-64/Debian60-64/summary.html

git

2015-05-07 18:36

administrator   ~0040766

Branch CR26139_2 has been updated by vpa.

SHA-1: 404000cafbb5c42b94de6e2aa6650dc5dffa77c1


Detailed log of new commits:

Author: vpa
Date: Thu May 7 18:36:16 2015 +0300

    Corrections

git

2015-05-07 18:39

administrator   ~0040767

Branch CR26139_3 has been created by vpa.

SHA-1: d85b3dc214a635690360723349928fac55ef065f


Detailed log of new commits:

Author: vpa
Date: Thu May 7 18:39:36 2015 +0300

    0026139: AIS_InteractiveContext::Display performance regression
    
    NCollection_Sequence in SelectMgr_SensitiveEntitySet was replaced by indexed data map

solomin_s

2015-05-07 19:22

developer   ~0040768

Add Draw test with stl model (send model to Sergey ANIKIN, because model is cannot be attached to the tracker). I've provided Amplifier screen shots with and without std::deque usage.

Occ release with deb info (last git):
Draw[4]> pload ALL
vinit
chrono
meshfromstl mesh /home/ssolomin/RL_Extern_NXSpeedBoat.stl
1
Draw[5]> Driver1/Viewer1/View1
Draw[6]> Chronometers activated.

Draw[7]> Nodes : 117256
Elements : 235534
Construction is finished
Reading OK...
Data source is created successful
MeshVS_Mesh is created successful

Elapsed time: 0 Hours 1 Minutes 0.053043 Seconds
CPU user time: 59.64 seconds
CPU system time: 0.14 seconds
Draw[8]>
Elapsed time: 0 Hours 0 Minutes 5.69999999982e-05 Seconds



Occ release with deb info (last git + std::deque usage):
Draw[4]> pload ALL
vinit
chrono
meshfromstl mesh /home/ssolomin/RL_Extern_NXSpeedBoat.stl1
Draw[5]> Driver1/Viewer1/View1
Draw[6]> Chronometers activated.

Draw[7]>
Nodes : 117256
Elements : 235534
Construction is finished
Reading OK...
Data source is created successful
MeshVS_Mesh is created successful

Elapsed time: 0 Hours 0 Minutes 3.682833 Seconds
CPU user time: 3.52 seconds
CPU system time: 0.15 seconds
Draw[8]> 3D View - Driver1/Viewer1/View1 was deleted.
exit

solomin_s

2015-05-07 19:22

developer  

Draw_RL_Extern_NXSpeedBoat.png (28,480 bytes)

solomin_s

2015-05-07 19:23

developer  

Draw_RL_Extern_NXSpeedBoat+deque.png (98,823 bytes)

solomin_s

2015-05-07 19:23

developer  

reproducer.tcl (82 bytes)

solomin_s

2015-05-08 13:25

developer   ~0040774

Hello, I've found Ncollection_BaseSequence is also bottleneck in OpenGl_BHVClipPrimitives. It became important when big models was displayed. See Big_Model_Times.png.

solomin_s

2015-05-08 13:25

developer  

Big_Model_Times.png (85,294 bytes)

solomin_s

2015-05-08 13:26

developer  

Big_Model_Times_deque.png (48,329 bytes)

git

2015-05-08 13:37

administrator   ~0040775

Branch CR26139_4 has been created by solomin_s.

SHA-1: aa60204badf933323804a6aabb708dd8e3b7b8b3


Detailed log of new commits:

Author: Sergey Solomin
Date: Fri May 8 13:36:13 2015 +0300

    0026139: AIS_InteractiveContext::Display performance regression
    
    Replacing NCollection_BaseSequence with std::deque

git

2015-05-08 13:37

administrator   ~0040776

Branch CR26139 has been deleted by solomin_s.

SHA-1: 7ca81119e46b375d9bc8adf9130efefc48b0a0d9

vpa

2015-05-08 15:19

developer   ~0040782

Last edited: 2015-05-08 15:26

Dear solomin_s,

please take a look at patch in branch CR26139_3, where NCollection_Sequence was replaced by NCollecion_IndexedMap. That change allowed to reduce display time up to 2.5 times and remove time up to 270 times (in comparison to OCCT v6.9.0 beta2). Note that dequeue solution you proposed requires iteration through collection to remove elements, meanwhile indexed map allows to do it in constant time.

Regarding to performance of OpenGl_BHVClipPrimitives, the bug will be fixed within issue 0026199. Thanks for your contribution! :)

git

2015-05-14 16:37

administrator   ~0041109

Branch CR26139_1 has been deleted by inv.

SHA-1: d48745b74e2d1e3002b5266bed67b76cb7818d40

git

2015-05-14 16:37

administrator   ~0041110

Branch CR26139_2 has been deleted by inv.

SHA-1: 404000cafbb5c42b94de6e2aa6650dc5dffa77c1

git

2015-05-14 16:38

administrator   ~0041111

Branch CR26139_3 has been deleted by inv.

SHA-1: d85b3dc214a635690360723349928fac55ef065f

git

2015-05-14 16:38

administrator   ~0041112

Branch CR26139_4 has been deleted by inv.

SHA-1: aa60204badf933323804a6aabb708dd8e3b7b8b3

Related Changesets

occt: master ec81011f

2015-05-07 15:39:36

abv


Committer: abv Details Diff
0026139: AIS_InteractiveContext::Display performance regression

NCollection_Sequence in SelectMgr_SensitiveEntitySet was replaced by indexed data map
Affected Issues
0026139
mod - src/QABugs/QABugs_19.cxx Diff File
mod - src/SelectMgr/SelectMgr_SelectableObjectSet.cxx Diff File
mod - src/SelectMgr/SelectMgr_SensitiveEntitySet.cxx Diff File
mod - src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx Diff File
add - tests/bugs/vis/bug26139 Diff File

occt: master 2cf5ec3f

2015-05-08 10:44:02

vpa


Committer: bugmaster Details Diff
0026139: AIS_InteractiveContext::Display performance regression

Regression with VIS tests in release mode was fixed
Affected Issues
0026139
mod - src/SelectMgr/SelectMgr_SelectableObjectSet.cxx Diff File

Issue History

Date Modified Username Field Change
2015-04-24 12:12 solomin_s New Issue
2015-04-24 12:12 solomin_s Assigned To => kgv
2015-04-24 12:12 solomin_s File Added: Screenshot from 2015-04-23 19:53:18.png
2015-04-24 12:13 solomin_s File Added: Screenshot from 2015-04-23 19:55:18.png
2015-04-24 12:13 solomin_s File Added: times1.png
2015-04-24 12:15 solomin_s Summary AIS_InteractiveContext::Display is slow => AIS_InteractiveContext::Display performance regression
2015-04-24 12:15 solomin_s Description Updated
2015-04-24 12:17 solomin_s Note Added: 0040202
2015-04-24 18:02 kgv Assigned To kgv => vpa
2015-04-24 18:02 kgv Status new => assigned
2015-04-24 18:03 kgv Relationship added related to 0024623
2015-04-24 23:29 git Note Added: 0040247
2015-04-24 23:32 solomin_s Note Added: 0040248
2015-04-25 07:13 abv Note Added: 0040249
2015-04-25 07:15 abv Note Edited: 0040249
2015-04-28 10:27 git Note Added: 0040315
2015-05-06 20:49 git Note Added: 0040681
2015-05-06 21:18 git Note Added: 0040687
2015-05-06 21:19 git Note Added: 0040688
2015-05-06 21:20 vpa Note Added: 0040689
2015-05-06 21:20 vpa Assigned To vpa => apl
2015-05-06 21:20 vpa Status assigned => resolved
2015-05-06 21:20 vpa Steps to Reproduce Updated
2015-05-06 21:23 apl Note Added: 0040690
2015-05-06 21:23 apl Assigned To apl => mkv
2015-05-06 21:23 apl Status resolved => reviewed
2015-05-06 21:24 apl Note Edited: 0040690
2015-05-07 07:42 bugmaster Note Added: 0040691
2015-05-07 07:42 bugmaster Assigned To mkv => vpa
2015-05-07 07:42 bugmaster Status reviewed => assigned
2015-05-07 10:24 git Note Added: 0040697
2015-05-07 10:24 abv Note Added: 0040698
2015-05-07 10:24 abv Assigned To vpa => kgv
2015-05-07 10:24 abv Status assigned => resolved
2015-05-07 10:24 abv Assigned To kgv => bugmaster
2015-05-07 10:24 abv Status resolved => reviewed
2015-05-07 11:10 mkv Assigned To bugmaster => apv
2015-05-07 11:53 kgv Relationship added related to 0026195
2015-05-07 14:32 apv Note Added: 0040735
2015-05-07 14:32 apv Assigned To apv => vpa
2015-05-07 14:32 apv Status reviewed => assigned
2015-05-07 18:36 git Note Added: 0040766
2015-05-07 18:39 git Note Added: 0040767
2015-05-07 19:14 vpa Status assigned => resolved
2015-05-07 19:14 vpa Assigned To vpa => bugmaster
2015-05-07 19:14 vpa Status resolved => reviewed
2015-05-07 19:22 solomin_s Note Added: 0040768
2015-05-07 19:22 solomin_s File Added: Draw_RL_Extern_NXSpeedBoat.png
2015-05-07 19:23 solomin_s File Added: Draw_RL_Extern_NXSpeedBoat+deque.png
2015-05-07 19:23 solomin_s File Added: reproducer.tcl
2015-05-08 13:25 solomin_s Note Added: 0040774
2015-05-08 13:25 solomin_s File Added: Big_Model_Times.png
2015-05-08 13:26 solomin_s File Added: Big_Model_Times_deque.png
2015-05-08 13:37 git Note Added: 0040775
2015-05-08 13:37 git Note Added: 0040776
2015-05-08 15:01 dbp Relationship added related to 0026199
2015-05-08 15:19 vpa Note Added: 0040782
2015-05-08 15:21 vpa Note Edited: 0040782
2015-05-08 15:22 vpa Note Edited: 0040782
2015-05-08 15:26 vpa Note Edited: 0040782
2015-05-08 15:49 bugmaster Changeset attached => occt master 2cf5ec3f
2015-05-08 15:49 abv Changeset attached => occt master ec81011f
2015-05-08 15:49 abv Assigned To bugmaster => abv
2015-05-08 15:49 abv Status reviewed => verified
2015-05-08 15:49 abv Resolution open => fixed
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:37 git Note Added: 0041109
2015-05-14 16:37 git Note Added: 0041110
2015-05-14 16:38 git Note Added: 0041111
2015-05-14 16:38 git Note Added: 0041112
2016-06-25 16:11 kgv Relationship added related to 0026626