View Issue Details

IDProjectCategoryView StatusLast Update
0026199Open CASCADEOCCT:Visualizationpublic2015-10-23 20:51
ReporterdbpAssigned Tobugmaster  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Target Version6.9.1Fixed in Version6.9.1 
Summary0026199: Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_BVHClipPrimitiveSet to improve performance
Description'vclear' is slow in case of large number of object (10^5 and more). It is necessary to redesign OpenGl_BVHClipPrimitiveSet to use more efficient collection.
Steps To Reproduce
pload MODELING VISUALIZATION
psphere s 0.5
tclean  s
incmesh s 0.1
trinfo  s

vinit View1
vclear
vaxo
vsetdispmode 1
vdefaults -defl 1.0 -autoTriang off
vdisplay s

set aNb1 100

# display 100x100 connected instances of single presentation
puts "Creating [expr $aNb1*$aNb1] instances..."
set t [time {for {set i 0} {$i < $aNb1} {incr i} {for {set j 0} {$j < $aNb1} {incr j} {vconnectto s_${i}_${j} ${i} ${j} 0 s -noupdate}}}]
set d1 [lindex $t 0]
puts "Done in $d1 microseconds!\n"

# the following command is slow
vclear
TagsNo tags attached.
Test case numberbugs vis(004) bug26199

Relationships

parent of 0026203 closedbugmaster Open CASCADE Foundation Classes - provide method ::Swap() for NCollection_IndexedMap and NCollection_IndexedDataMap 
related to 0026139 closedabv Community AIS_InteractiveContext::Display performance regression 
related to 0026220 closedbugmaster Open CASCADE Visualization - In Graphic3d_Structure use single NCollection_IndexedMap instead of NCollection_DataMap and NCollection_Sequence 
related to 0026221 closedbugmaster Open CASCADE Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_Layer to improve performance 

Activities

git

2015-05-08 18:17

administrator   ~0040811

Branch CR26199 has been created by dbp.

SHA-1: b0b3e08b93a6c64239c9a902099c588dc7cc4431


Detailed log of new commits:

Author: dbp
Date: Fri May 8 18:17:12 2015 +0300

    0026199: Visualization - OpenGl_BVHClipPrimitiveSet::Remove() is slow due to the use of NCollection_Sequence
    
    This patch improves performance of OpenGl_BVHClipPrimitiveSet. In particular, on the attached test case for 90 000 boxes the results are the following:
    
    1) Master: vdisplay - 55 sec, 5 FPS, 1.4 GB memory, vclear - 180 sec.
    2) Branch: vdisplay - 1.3 sec, 5 FPS, 1.4 GB memory, vclear - 90 sec.
    
    So, the patch improves vdisplay in ~40 times, and vclear in ~2 times without extra memory and with no impact on rendering performance. However, the vclear time is still significant. According to profile results, it is due to Graphic3d_Structure::DisconnectAll method.

dbp

2015-05-08 18:18

developer   ~0040812

Dear kgv,

please review the patch in branch CR26199.

kgv

2015-05-08 20:23

developer   ~0040813

Patch is ready for testing, but please update commit description before integration.

mkv

2015-05-13 20:06

tester   ~0040869

Dear BugMaster,
Branch CR26199 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: b0b3e08b93a6c64239c9a902099c588dc7cc4431

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:
http://occt-tests/CR26199-master-occt-64/Debian60-64/bugs/vis/bug23654_MarkersRecompute.html
http://occt-tests/CR26199-master-occt-64/Windows-64-VC10/bugs/vis/bug23654_MarkersRecompute.html
bugs vis(004) bug23654_MarkersRecompute

http://occt-tests/CR26199-master-occt-64/Debian60-64/bugs/vis/bug24131_markers.html
http://occt-tests/CR26199-master-occt-64/Windows-64-VC10/bugs/vis/bug24131_markers.html
bugs vis(004) bug24131_markers

Testing cases:


Testing on Linux:
occt component :
Total MEMORY difference: 95415997 / 95509523 [-0.10%]
Total CPU difference: 53780.77999999937 / 51840.519999999386 [+3.74%]
products component :
Total MEMORY difference: 23841948 / 23898135 [-0.24%]
Total CPU difference: 17345.749999999996 / 16271.109999999975 [+6.60%]

Testing on Windows:
occt component :
Total MEMORY difference: 59157126 / 59102266 [+0.09%]
Total CPU difference: 17177.9409142989 / 17075.853859898856 [+0.60%]
products component :
Total MEMORY difference: 15632998 / 15636788 [-0.02%]
Total CPU difference: 6516.114969699989 / 6469.236669199996 [+0.72%]

There are no differences in images found by testdiff.

git

2015-05-14 11:59

administrator   ~0040885

Branch CR26199_1 has been created by dbp.

SHA-1: 8e60a5c42a290c7f28ca38e2a73c4de3d640d1c0


Detailed log of new commits:

Author: dbp
Date: Fri May 8 18:17:12 2015 +0300

    0026199: Visualization - OpenGl_BVHClipPrimitiveSet::Remove() is slow due to the use of NCollection_Sequence
    
    This patch improves performance of OpenGl_BVHClipPrimitiveSet. In particular, on the attached test case for 90 000 boxes the results are the following:
    
    1) Master: vdisplay - 55 sec, 5 FPS, 1.4 GB memory, vclear - 180 sec.
    2) Branch: vdisplay - 1.3 sec, 5 FPS, 1.4 GB memory, vclear - 90 sec.
    
    So, the patch improves vdisplay in ~40 times, and vclear in ~2 times without extra memory and with no impact on rendering performance. However, the vclear time is still significant. According to profile results, it is due to Graphic3d_Structure::DisconnectAll method.

dbp

2015-05-14 12:01

developer   ~0040887

Dear kgv,

the bug was fixed in another branch (0026203). This patch was rebased on corrected CR26203 and pushed to branch CR26199_1.

git

2015-05-14 12:12

administrator   ~0040890

Branch CR26199_1 has been updated forcibly by dbp.

SHA-1: 37e1e772972e66fd9396f3d427f2d848dc1c727e

kgv

2015-05-14 12:16

developer   ~0040894

Please test updated patch.

git

2015-05-15 16:50

administrator   ~0041185

Branch CR26199_1 has been updated forcibly by mkv.

SHA-1: 8251430f234a63b4094a7a0740dcfaba02dc2dc1

mkv

2015-05-18 15:18

tester   ~0041235

Dear BugMaster,
Branch CR26199_1 was rebased on current master of occt git-repository.
SHA-1: 60f602b8fbd0c24a0d6dbc0b4450bc780e998bb5

mkv

2015-05-18 15:19

tester   ~0041236

Last edited: 2015-05-19 14:51

Dear BugMaster,
Branch CR26199_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 60f602b8fbd0c24a0d6dbc0b4450bc780e998bb5

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:
No regressions/differences

Testing cases:
http://occt-tests/CR26199-1-master-occt-64/Debian70-64/bugs/vis/bug26199.html
http://occt-tests/CR26199-1-master-occt-64/Windows-64-VC10/bugs/vis/bug26199.html
bugs vis(004) bug26199: OK

Testing on Linux:
occt component :
Total MEMORY difference: 99960057 / 100094404 [-0.13%]
Total CPU difference: 19524.47999999998 / 19358.840000000175 [+0.86%]
products component :
Total MEMORY difference: 24217802 / 24391409 [-0.71%]
Total CPU difference: 7919.630000000018 / 7582.950000000026 [+4.44%]

Testing on Windows:
occt component :
Total MEMORY difference: 58903670 / 59280108 [-0.64%]
Total CPU difference: 16918.963654198968 / 16999.460170198952 [-0.47%]
products component :
Total MEMORY difference: 15650266 / 15653430 [-0.02%]
Total CPU difference: 6600.854712899992 / 6567.907301699987 [+0.50%]

There are no differences in images found by testdiff.

mkv

2015-05-19 14:52

tester   ~0041278

Dear dbp,
could you please review following test case
bugs vis(004) bug26199: OK

There is following warning after vdefaults draw-command:
Warning, unknown argument '-DEFL'

git

2015-05-19 14:53

administrator   ~0041279

Branch CR26199_1 has been updated by mkv.

SHA-1: 7581c402ec735c39f1a4be02c2867a50323fad8b


Detailed log of new commits:

Author: mkv
Date: Tue May 19 14:47:00 2015 +0300

    Test case for issue CR26199

dbp

2015-05-20 10:15

developer   ~0041297

Dear mkv,

test case bug26199 is OK.

dbp

2015-05-20 10:16

developer   ~0041298

Dear bugmaster,

test case bug26199 was reviewed. Please proceed.

kgv

2015-05-20 10:24

developer   ~0041299

Dear Denis,

> There is following warning after vdefaults draw-command:
> Warning, unknown argument '-DEFL'
please fix misprint in implementation of vdefaults command within the patch.

    }
    if (anArg == "-AUTOTR"
     || anArg == "-AUTOTRIANG"
     || anArg == "-AUTOTRIANGULATION")

here should be else if.

git

2015-05-21 12:46

administrator   ~0041371

Branch CR26199_1 has been updated by dbp.

SHA-1: bc0ee9af24f88b8a0bb2e71418a89769f40f4d17


Detailed log of new commits:

Author: dbp
Date: Thu May 21 12:46:10 2015 +0300

    Fix invalid warnings in 'vdefaults' command.

dbp

2015-05-21 12:47

developer   ~0041372

Dear bugmaster,

invalid warnings in 'vdefaults' command were fixed. Please proceed with branch CR26199_1.

kgv

2015-05-21 12:53

developer   ~0041374

Please take patch into IR - retesting is not needed.

mkv

2015-05-21 13:32

tester   ~0041377

Dear BugMaster,
Branch CR26199_1 is TESTED.

git

2015-07-27 13:48

administrator   ~0043544

Branch CR26199 has been deleted by kgv.

SHA-1: b0b3e08b93a6c64239c9a902099c588dc7cc4431

git

2015-07-27 13:48

administrator   ~0043545

Branch CR26199_1 has been deleted by kgv.

SHA-1: bc0ee9af24f88b8a0bb2e71418a89769f40f4d17

Related Changesets

occt: master 385c43e7

2015-05-21 11:30:38

dbp


Committer: bugmaster Details Diff
0026199: Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_BVHClipPrimitiveSet to improve performance

This patch improves performance of OpenGl_BVHClipPrimitiveSet. In particular, on the attached test case for 90 000 spheres the results are the following:

1) Master: vdisplay - 55 sec, 5 FPS, 1.4 GB memory, vclear - 180 sec.
2) Branch: vdisplay - 1.3 sec, 5 FPS, 1.4 GB memory, vclear - 90 sec.

So, the patch improves vdisplay in ~40 times, and vclear in ~2 times without extra memory and with no impact on rendering performance. However, the vclear time is still significant. According to profile results, it is due to Graphic3d_Structure::DisconnectAll method.

Test case for issue CR26199

Fix invalid warnings in 'vdefaults' command.
Affected Issues
0026199
mod - src/OpenGl/OpenGl_BVHClipPrimitiveSet.cxx Diff File
mod - src/OpenGl/OpenGl_BVHClipPrimitiveSet.hxx Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File
add - tests/bugs/vis/bug26199 Diff File

Issue History

Date Modified Username Field Change
2015-05-07 19:10 dbp New Issue
2015-05-07 19:10 dbp Assigned To => kgv
2015-05-08 15:01 dbp Relationship added related to 0026139
2015-05-08 15:06 kgv Assigned To kgv => vpa
2015-05-08 15:06 kgv Status new => assigned
2015-05-08 15:06 kgv Summary Visualization - OpenGl_BVHClipPrimitiveSet::Remove is slow due to the use of NCollection_Sequence => Visualization - OpenGl_BVHClipPrimitiveSet::Remove() is slow due to the use of NCollection_Sequence
2015-05-08 15:06 kgv Steps to Reproduce Updated
2015-05-08 16:09 dbp Assigned To vpa => dbp
2015-05-08 18:17 git Note Added: 0040811
2015-05-08 18:18 dbp Note Added: 0040812
2015-05-08 18:18 dbp Assigned To dbp => kgv
2015-05-08 18:18 dbp Status assigned => resolved
2015-05-08 20:23 kgv Note Added: 0040813
2015-05-08 20:23 kgv Assigned To kgv => bugmaster
2015-05-08 20:23 kgv Severity minor => feature
2015-05-08 20:23 kgv Status resolved => reviewed
2015-05-08 20:23 kgv Summary Visualization - OpenGl_BVHClipPrimitiveSet::Remove() is slow due to the use of NCollection_Sequence => Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_BVHClipPrimitiveSet to improve performance
2015-05-12 12:12 mkv Assigned To bugmaster => mkv
2015-05-13 18:48 dbp Relationship added related to 0026220
2015-05-13 18:49 dbp Relationship added related to 0026221
2015-05-13 20:06 mkv Note Added: 0040869
2015-05-13 20:06 mkv Assigned To mkv => dbp
2015-05-13 20:06 mkv Status reviewed => assigned
2015-05-14 11:59 git Note Added: 0040885
2015-05-14 12:01 dbp Note Added: 0040887
2015-05-14 12:01 dbp Assigned To dbp => kgv
2015-05-14 12:01 dbp Status assigned => resolved
2015-05-14 12:12 git Note Added: 0040890
2015-05-14 12:16 kgv Note Added: 0040894
2015-05-14 12:16 kgv Assigned To kgv => bugmaster
2015-05-14 12:16 kgv Status resolved => reviewed
2015-05-14 12:21 mkv Assigned To bugmaster => mkv
2015-05-15 16:50 git Note Added: 0041185
2015-05-18 15:18 mkv Note Added: 0041235
2015-05-18 15:19 mkv Note Added: 0041236
2015-05-18 15:19 mkv Assigned To mkv => bugmaster
2015-05-18 15:19 mkv Status reviewed => tested
2015-05-18 15:20 mkv Test case number => perf ncollection(002) A2, A3, A4
2015-05-19 14:51 mkv Note Edited: 0041236
2015-05-19 14:52 mkv Note Added: 0041278
2015-05-19 14:52 mkv Assigned To bugmaster => dbp
2015-05-19 14:52 mkv Status tested => feedback
2015-05-19 14:53 mkv Test case number perf ncollection(002) A2, A3, A4 => bugs vis(004) bug26199
2015-05-19 14:53 git Note Added: 0041279
2015-05-20 10:15 dbp Note Added: 0041297
2015-05-20 10:16 dbp Note Added: 0041298
2015-05-20 10:16 dbp Assigned To dbp => bugmaster
2015-05-20 10:16 dbp Status feedback => reviewed
2015-05-20 10:24 kgv Note Added: 0041299
2015-05-20 10:24 kgv Assigned To bugmaster => dbp
2015-05-20 10:24 kgv Status reviewed => feedback
2015-05-21 12:46 git Note Added: 0041371
2015-05-21 12:47 dbp Note Added: 0041372
2015-05-21 12:47 dbp Assigned To dbp => bugmaster
2015-05-21 12:47 dbp Status feedback => reviewed
2015-05-21 12:53 kgv Note Added: 0041374
2015-05-21 13:32 mkv Note Added: 0041377
2015-05-21 13:32 mkv Status reviewed => tested
2015-05-22 12:19 bugmaster Changeset attached => occt master 385c43e7
2015-05-22 12:19 bugmaster Status tested => verified
2015-05-22 12:19 bugmaster Resolution open => fixed
2015-05-29 14:19 bugmaster Target Version 7.1.0 => 7.0.0
2015-07-27 13:48 git Note Added: 0043544
2015-07-27 13:48 git Note Added: 0043545
2015-08-20 09:26 abv Relationship added parent of 0026203
2015-08-26 11:11 abv Target Version 7.0.0 => 6.9.1
2015-10-16 14:56 aiv Status verified => closed
2015-10-23 20:51 aiv Fixed in Version => 6.9.1