1 puts "TODO OCC26471 Linux: Error: OCCT DownCast is expected to be faster!"
4 puts "CR24023, check operability and performance of OCCT RTTI and handles"
15 # check performance of creation and destruction handles, vs. C++ shared_ptr
17 set res_lines [split $res \n]
18 set time_occt [lindex [split [lindex $res_lines 1] :] end]
19 set time_std [lindex [split [lindex $res_lines 2] :] end]
20 set ratio [expr $time_occt / $time_std]
23 if { $ratio > 1.05 } {
24 puts "Error: OCCT handle is too slow: $time_occt vs. $time_std of shared_ptr"
27 # Check performance of down casting at different nesting depths.
28 # OCCT is expected to be the same as C++
29 set depths {3 5 10 50}
32 for {set i 0} {$i < [llength $depths]} {incr i} {
33 set depth [lindex $depths $i]
34 puts "\nTesting DownCast at nesting depth $depth"
36 set res [QAHandleCast $depth 0 100000]
37 set res_lines [split $res \n]
38 set time_occt [lindex [lindex [split [lindex $res_lines end-2] :] end] end]
39 set time_std [lindex [lindex [split [lindex $res_lines end-1] :] end] end]
40 set time_ptr [lindex [lindex [split [lindex $res_lines end ] :] end] end]
41 set ratio_std [expr $time_occt / $time_std]
42 set ratio_ptr [expr $time_occt / $time_ptr]
44 puts "Ratio of time of OCCT DownCast() to dynamic_cast<>: $ratio_std"
45 puts "Ratio of time of OCCT DownCast() to dynamic_pointer_cast<>: $ratio_ptr"
47 if { $ratio_std > $threshold_std || $ratio_ptr > $threshold_ptr } {
48 puts "Error: OCCT DownCast is expected to be faster!"