0025487: Extrema_GenExtPS needs to be optimized
[occt.git] / tests / bugs / moddata_3 / bug25487_1
diff --git a/tests/bugs/moddata_3/bug25487_1 b/tests/bugs/moddata_3/bug25487_1
new file mode 100644 (file)
index 0000000..a6eb562
--- /dev/null
@@ -0,0 +1,73 @@
+puts "========"
+puts "OCC25487"
+puts "========"
+puts ""
+##########################################
+# Extrema_GenExtPS needs to be optimized
+##########################################
+
+pload DATAEXCHANGEKERNEL
+
+# Restore testing shape and get timing characteristics for operation stepread
+dchrono perf_h reset
+dchrono perf_h start
+stepread [locate_data_file OCC25487_LP1.stp] a *
+dchrono perf_h stop
+
+# Get elapsed time for operation stepread
+set chrono_info [dchrono perf_h show]
+regexp {CPU user time: ([-0-9.+eE]+) seconds} $chrono_info full CPU_time
+puts "Elapsed time is: $CPU_time"
+
+# Check current OS
+set currentOS $tcl_platform(os)
+
+# Check prformance on Windows
+if {[string compare $currentOS "Windows NT"] == 0} {
+  if {[regexp {Debug mode} [dversion]]} {
+    # DEBUG mode
+    # initial CPU_time for WINDOWS in DEBUG mode is 410 ((186+19)*2) sec
+    puts "Checking WINDOWS performance in debug mode..."
+    if {$CPU_time > 410.} {
+      puts "ERROR: OCC25487 is reproduced."
+      puts "       Low performance: $CPU_time (but should be less than 410 sec)"
+    } else {
+      puts "Done!"
+    }
+  } else {
+    # OPTIMIZE mode
+    # initial CPU_time for WINDOWS in OPTIMIZE mode is 205 (186+19) sec
+    puts "Checking WINDOWS performance in optimize mode..."
+    if {$CPU_time > 205.} {
+      puts "ERROR: OCC25487 is reproduced."
+      puts "       Low performance: $CPU_time (but should be less than 205 sec)"
+    } else {
+      puts "Done!"
+    }
+  }
+}
+
+# Check performance on Linux
+if {[string compare $currentOS "Linux"] == 0} {
+  if {[regexp {Debug mode} [dversion]]} {
+    # DEBUG mode
+    # initial CPU_time for LINUX in DEBUG mode is 292 ((132+14)*2) sec
+    puts "Checking LINUX performance in debug mode..."
+    if {$CPU_time > 292.} {
+      puts "ERROR: OCC25487 is reproduced."
+      puts "       Low performance: $CPU_time (but should be less than 292 sec)"
+    } else {
+      puts "Done!"
+    }
+  } else {
+    # OPTIMIZE mode
+    # initial CPU_time for LINUX in OPTIMIZE mode is 146 (132+14) sec
+    puts "Checking LINUX performance in optimize mode..."
+    if {$CPU_time > 146.} {
+      puts "ERROR: OCC25487 is reproduced."
+      puts "       Low performance: $CPU_time (but should be less than 146 sec)"
+    } else {
+      puts "Done!"
+    }
+  }
+}