|
@@ -24,6 +24,9 @@ CURRENT_FOLDER_NAME = "performance"
|
|
|
|
|
|
PORTS = set()
|
|
|
|
|
|
+OPTIMIZATION_LEVEL_INTERPRETER = "interpreter"
|
|
|
+OPTIMIZATION_LEVEL_BASELINE_JIT = "baseline-jit"
|
|
|
+
|
|
|
class ModelverseTerminated(Exception):
|
|
|
"""An exception that tells the user that the Modelverse has terminated."""
|
|
|
pass
|
|
@@ -223,13 +226,15 @@ def run_file_single_output(files, parameters, mode):
|
|
|
and then collects and returns a single output."""
|
|
|
return run_file_fixed_output_count(files, parameters, mode, 1)[0]
|
|
|
|
|
|
-def run_perf_test(files, parameters, mode, n_iterations=1):
|
|
|
+def run_perf_test(files, parameters, optimization_level, n_iterations=1):
|
|
|
"""Compiles the given sequence of files, feeds them the given input in the given mode,
|
|
|
and then collects their output. This process is repeated n_iterations times. The
|
|
|
return value is the average of all outputs."""
|
|
|
result = 0.0
|
|
|
for _ in xrange(n_iterations):
|
|
|
- result += float(run_file_single_output(files, parameters, mode)) / float(n_iterations)
|
|
|
+ result += float(
|
|
|
+ run_file_single_output(
|
|
|
+ files, [optimization_level] + parameters + [0], 'CO')) / float(n_iterations)
|
|
|
return result
|
|
|
|
|
|
def format_output(output):
|