diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-11-17 11:57:15 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-11-17 11:57:15 -0800 |
commit | c300de847b2f2d420f4dc416b0f3852f9665303d (patch) | |
tree | da2920493c2d4af032279658e510c83edd76f50d | |
parent | 98a7fbd6a30160575c2d092579f806833288b744 (diff) |
use clang for native code comparisons, for more valid benchmark results
-rw-r--r-- | tests/runner.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py index 82b46fac..14e1d42f 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -159,8 +159,8 @@ class RunnerCore(unittest.TestCase): def run_llvm_interpreter(self, args): return Popen([EXEC_LLVM] + args, stdout=PIPE, stderr=STDOUT).communicate()[0] - def build_native(self, filename, compiler='g++'): - Popen([compiler, '-O3', filename, '-o', filename+'.native'], stdout=PIPE, stderr=STDOUT).communicate()[0] + def build_native(self, filename): + Popen([CLANG, '-O2', filename, '-o', filename+'.native'], stdout=PIPE, stderr=STDOUT).communicate()[0] def run_native(self, filename, args): Popen([filename+'.native'] + args, stdout=PIPE, stderr=STDOUT).communicate()[0] @@ -4525,8 +4525,8 @@ else: final /= len(times) print - print ' JavaScript : mean: %.3f (+-%.3f) seconds (max: %.3f, min: %.3f, noise/signal: %.3f) (%d runs)' % (mean, std, max(times), min(times), std/mean, TEST_REPS) - print ' Native (gcc): mean: %.3f (+-%.3f) seconds (max: %.3f, min: %.3f, noise/signal: %.3f) JS is %.2f X slower' % (mean_native, std_native, max(native_times), min(native_times), std_native/mean_native, final) + print ' JavaScript: mean: %.3f (+-%.3f) seconds (max: %.3f, min: %.3f, noise/signal: %.3f) (%d runs)' % (mean, std, max(times), min(times), std/mean, TEST_REPS) + print ' Native : mean: %.3f (+-%.3f) seconds (max: %.3f, min: %.3f, noise/signal: %.3f) JS is %.2f X slower' % (mean_native, std_native, max(native_times), min(native_times), std_native/mean_native, final) def do_benchmark(self, src, args=[], expected_output='FAIL', main_file=None): dirname = self.get_dir() |