aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-08-30 11:41:52 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-08-30 11:41:52 -0700
commit639775b8a012a89e19ae5ba3ce459248b4cd98a9 (patch)
treebfb9400888f893b332ffb0cc85ec9a47b26b4d2e
parent194f0f926916a7f06c350392979f74b038adf9bd (diff)
make it easier to run specific benchmarks
-rw-r--r--tests/runner.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 0a6965b6..d452bb74 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -233,7 +233,7 @@ class RunnerCore(unittest.TestCase):
###################################################################################################
-if 'benchmark' not in sys.argv:
+if 'benchmark' not in str(sys.argv):
# Tests
print "Running Emscripten tests..."
@@ -3953,7 +3953,8 @@ TT = %s
self.assertEquals(output, expected)
else:
- # Benchmarks
+ # Benchmarks. Run them with argument |benchmark|. To run a specific test, do
+ # |benchmark.test_X|.
print "Running Emscripten benchmarks..."
@@ -3995,7 +3996,7 @@ else:
total_times = map(lambda x: 0., range(TEST_REPS))
total_native_times = map(lambda x: 0., range(TEST_REPS))
- class Benchmark(RunnerCore):
+ class benchmark(RunnerCore):
def print_stats(self, times, native_times):
mean = sum(times)/len(times)
squared_times = map(lambda x: x*x, times)
@@ -4135,7 +4136,7 @@ else:
old_quantum = QUANTUM_SIZE
old_use_typed_arrays = USE_TYPED_ARRAYS
QUANTUM_SIZE = 1
- USE_TYPED_ARRAYS = 0 # Rounding errors with TA2 are too big in this very rounding-sensitive code
+ USE_TYPED_ARRAYS = 0 # Rounding errors with TA2 are too big in this very rounding-sensitive code. However, TA2 is much faster (2X)
src = open(path_from_root('tests', 'raytrace.cpp'), 'r').read().replace('double', 'float') # benchmark with floats
self.do_benchmark(src, ['7', '256'], '256 256')