0027146: Create command checkplatform
[occt.git] / tests / bugs / moddata_3 / bug25487_2
CommitLineData
150e93a7 1puts "========"
2puts "OCC25487"
3puts "========"
4puts ""
5##########################################
6# Extrema_GenExtPS needs to be optimized
7##########################################
8
e159a668 9cpulimit 1500
10
150e93a7 11pload DATAEXCHANGEKERNEL
12
13# Restore testing shape and get timing characteristics for operation stepread
14dchrono perf_h reset
15dchrono perf_h start
16stepread [locate_data_file OCC25487_LP2.stp] a *
17dchrono perf_h stop
18
19# Get elapsed time for operation stepread
20set chrono_info [dchrono perf_h show]
21regexp {CPU user time: ([-0-9.+eE]+) seconds} $chrono_info full CPU_time
22puts "Elapsed time is: $CPU_time"
23
150e93a7 24# Check prformance on Windows
863f782a 25if { [checkplatform -windows] } {
150e93a7 26 if {[regexp {Debug mode} [dversion]]} {
27 # DEBUG mode
28 # initial CPU_time for WINDOWS in DEBUG mode is 1208 ((549+55)*2) sec
29 puts "Checking WINDOWS performance in debug mode..."
30 if {$CPU_time > 1208.} {
31 puts "ERROR: OCC25487 is reproduced."
32 puts " Low performance: $CPU_time (but should be less than 1208 sec)"
33 } else {
34 puts "Done!"
35 }
36 } else {
37 # OPTIMIZE mode
38 # initial CPU_time for WINDOWS in OPTIMIZE mode is 604 (549+55) sec
39 puts "Checking WINDOWS performance in optimize mode..."
40 if {$CPU_time > 604.} {
41 puts "ERROR: OCC25487 is reproduced."
42 puts " Low performance: $CPU_time (but should be less than 604 sec)"
43 } else {
44 puts "Done!"
45 }
46 }
863f782a 47} else {
150e93a7 48 if {[regexp {Debug mode} [dversion]]} {
49 # DEBUG mode
e159a668 50 # initial CPU_time for LINUX in DEBUG mode is 1500 sec
150e93a7 51 puts "Checking LINUX performance in debug mode..."
e159a668 52 if {$CPU_time > 1500.} {
150e93a7 53 puts "ERROR: OCC25487 is reproduced."
e159a668 54 puts " Low performance: $CPU_time (but should be less than 1500 sec)"
150e93a7 55 } else {
56 puts "Done!"
57 }
58 } else {
59 # OPTIMIZE mode
e159a668 60 # initial CPU_time for LINUX in OPTIMIZE mode is 575 (523+52) sec
150e93a7 61 puts "Checking LINUX performance in optimize mode..."
e159a668 62 if {$CPU_time > 575.} {
150e93a7 63 puts "ERROR: OCC25487 is reproduced."
e159a668 64 puts " Low performance: $CPU_time (but should be less than 575 sec)"
150e93a7 65 } else {
66 puts "Done!"
67 }
68 }
69}