DiscussionsIssue archiveOCCT:Visualization

Archived issue #0026221

Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_Layer to improve performance

Open CASCADEOCCT:Visualizationclosed12 public notes

Search issues

Description

bool OpenGl_Layer::Remove (const OpenGl_Structure* theStruct,
                           Standard_Integer& thePriority,
                           Standard_Boolean isForChangePriority)

is bottleneck in case of removing large number of connected objects. For attached test case it takes ~ 30 seconds (in release mode, Core i5 3.1 GHz).

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

# disable output of commands
decho off

set aNb1 300

# display 300x300 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"

# this command is slow (~ 30 secs)
vclear

Public activity

12 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: Fri May 22 13:38:37 2015 +0300

    0026221: Visualization - Revise OpenGl_Layer to use more efficient collection for OpenGl_Structures
02Commenter 2
Dear kgv,

please review the patch in branch CR26221.

This patch eliminates last known bottleneck when processing large number of (connected) obejcts. In fact, both displaying and removing 90 000 of spheres (from test case) now takes 1-2 seconds. Both memory consumption and rendering performance were not affected.
03Commenter 2
Branch [archived branch] has been created by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Mon May 25 09:43:06 2015 +0300

    Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_Layer to improve performance
04Commenter 3
Dear Denis,

please complete the patch and process OpenGl_View::myImmediateList, so that OpenGl_SequenceOfStructure type can be removed.
05Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Mon May 25 09:43:06 2015 +0300

    Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_Layer to improve performance
06Commenter 6
Dear kgv,

please review the patch in branch CR26221_2.
07Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
08Commenter 3
Please test the patch.
09Commenter 9
Dear Commenter 1,
Branch CR26221_2 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 25 (25 on master)
Windows: 0 (0 on master)

products component :
Linux: 37 (37 on master)
Windows: 0 (0 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
http://occt-tests/CR26221-2-master-occt-64/Debian70-64/bugs/vis/bug26199.html
http://occt-tests/CR26221-2-master-occt-64/Windows-64-VC10/bugs/vis/bug26199.html
bugs vis bug26199: OK

Testing on Linux:
occt component :
Total MEMORY difference: 99919376 / 99834711 [+0.08%]
Total CPU difference: 18922.18000000004 / 18381.79000000015 [+2.94%]
products component :
Total MEMORY difference: 24094088 / 24303876 [-0.86%]
Total CPU difference: 8072.450000000004 / 7853.200000000018 [+2.79%]

Testing on Windows:
occt component :
Total MEMORY difference: 59055247 / 58652092 [+0.69%]
Total CPU difference: 16948.135841198928 / 16786.17560299903 [+0.96%]
products component :
Total MEMORY difference: 15633460 / 15628514 [+0.03%]
Total CPU difference: 6591.104650399998 / 6588.515033799982 [+0.04%]

There are no differences in images found by testdiff.
10Commenter 2
Branch [archived branch] has been deleted by Commenter 3.

[revision removed]
11Commenter 2
Branch [archived branch] has been deleted by Commenter 3.

[revision removed]
12Commenter 2
Branch [archived branch] has been deleted by Commenter 3.

[revision removed]

Related records