mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-06 10:36:12 +03:00
Debug code enabled with OCCT_DEBUG macro corrected for compiling with new handles. QANCollection_Handle.cxx simplified so as to avoid need of using /bigobj option when building by Visual Studio; templates of project files, CMake projects, and test perf fclasses handle corrected accordingly. Script genproj corrected to recognize VTK and to build DRAWEXE as executable (rather than DLL).
48 lines
1.6 KiB
Plaintext
48 lines
1.6 KiB
Plaintext
puts "========"
|
|
puts "CR24023, check operability and performance of OCCT RTTI and handles"
|
|
puts "========"
|
|
puts ""
|
|
|
|
pload QAcommands
|
|
|
|
# check RTTI
|
|
QAHandleBool
|
|
QAHandleKind
|
|
QAHandleOps
|
|
|
|
# check performance of creation and destruction handles, vs. C++ shared_ptr
|
|
set res [QAHandleInc]
|
|
set res_lines [split $res \n]
|
|
set time_occt [lindex [split [lindex $res_lines 1] :] end]
|
|
set time_std [lindex [split [lindex $res_lines 2] :] end]
|
|
set ratio [expr $time_occt / $time_std]
|
|
|
|
# allow 5% deviation
|
|
if { $ratio > 1.05 } {
|
|
puts "Error: OCCT handle is too slow: $time_occt vs. $time_std of shared_ptr"
|
|
}
|
|
|
|
# Check performance of down casting at different nesting depths.
|
|
# OCCT is expected to be the same as C++
|
|
set depths {3 5 10 50}
|
|
set threshold_std 1.15
|
|
set threshold_ptr 1.05
|
|
for {set i 0} {$i < [llength $depths]} {incr i} {
|
|
set depth [lindex $depths $i]
|
|
puts "\nTesting DownCast at nesting depth $depth"
|
|
|
|
set res [QAHandleCast $depth 0 100000]
|
|
set res_lines [split $res \n]
|
|
set time_occt [lindex [lindex [split [lindex $res_lines end-2] :] end] end]
|
|
set time_std [lindex [lindex [split [lindex $res_lines end-1] :] end] end]
|
|
set time_ptr [lindex [lindex [split [lindex $res_lines end ] :] end] end]
|
|
set ratio_std [expr $time_occt / $time_std]
|
|
set ratio_ptr [expr $time_occt / $time_ptr]
|
|
|
|
puts "Ratio of time of OCCT DownCast() to dynamic_cast<>: $ratio_std"
|
|
puts "Ratio of time of OCCT DownCast() to dynamic_pointer_cast<>: $ratio_ptr"
|
|
|
|
if { $ratio_std > $threshold_std || $ratio_ptr > $threshold_ptr } {
|
|
puts "Error: OCCT DownCast() is expected to be faster!"
|
|
}
|
|
} |