mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
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.
This commit is contained in:
70
tests/bugs/vis/bug26199
Normal file
70
tests/bugs/vis/bug26199
Normal file
@@ -0,0 +1,70 @@
|
||||
puts "=========="
|
||||
puts "OCC26199"
|
||||
puts "=========="
|
||||
puts ""
|
||||
############################################################
|
||||
# Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_BVHClipPrimitiveSet to improve performance
|
||||
############################################################
|
||||
|
||||
psphere s 0.5
|
||||
tclean s
|
||||
incmesh s 0.1
|
||||
trinfo s
|
||||
|
||||
vinit View1
|
||||
vclear
|
||||
vaxo
|
||||
vsetdispmode 1
|
||||
|
||||
vdefaults -defl 1.0 -autoTriang off
|
||||
# Warning, unknown argument '-DEFL'
|
||||
|
||||
vdisplay s
|
||||
|
||||
set aNb1 100
|
||||
|
||||
# display 100x100 connected instances of single presentation
|
||||
puts "Creating [expr $aNb1*$aNb1] instances..."
|
||||
set t1 [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}}}]
|
||||
|
||||
# the following command is slow
|
||||
set t2 [time {vclear}]
|
||||
|
||||
set d1 [lindex $t1 0]
|
||||
puts "vconnectto done in $d1 microseconds!\n"
|
||||
|
||||
set d2 [lindex $t2 0]
|
||||
puts "vclear done in $d2 microseconds!\n"
|
||||
|
||||
set t1_sec [expr $d1 * 1.e-6]
|
||||
set t2_sec [expr $d2 * 1.e-6]
|
||||
|
||||
if { [regexp {Debug mode} [dversion]] } {
|
||||
if { [regexp {Windows} [dversion]] } {
|
||||
set max_time_vconnectto 5
|
||||
set max_time_vclear 5
|
||||
} else {
|
||||
set max_time_vconnectto 5
|
||||
set max_time_vclear 5
|
||||
}
|
||||
} else {
|
||||
if { [regexp {Windows} [dversion]] } {
|
||||
set max_time_vconnectto 1
|
||||
set max_time_vclear 1
|
||||
} else {
|
||||
set max_time_vconnectto 1
|
||||
set max_time_vclear 1
|
||||
}
|
||||
}
|
||||
|
||||
if { ${t1_sec} > ${max_time_vconnectto} } {
|
||||
puts "Elapsed time of vconnectto is more than ${max_time_vconnectto} seconds - Error"
|
||||
} else {
|
||||
puts "Elapsed time of vconnectto is less than ${max_time_vconnectto} seconds - OK"
|
||||
}
|
||||
|
||||
if { ${t2_sec} > ${max_time_vclear} } {
|
||||
puts "Elapsed time of vclear is more than ${max_time_vclear} seconds - Error"
|
||||
} else {
|
||||
puts "Elapsed time of vclear is less than ${max_time_vclear} seconds - OK"
|
||||
}
|
Reference in New Issue
Block a user