From 9c1af72a66e40ba33cc7fe4a40ba393bec4a8298 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 7 May 2013 16:34:04 -0700 Subject: [PATCH] Add asmjs-apps to awfy driver. --- driver/benchmark.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/driver/benchmark.py b/driver/benchmark.py index faee691..b860bcb 100644 --- a/driver/benchmark.py +++ b/driver/benchmark.py @@ -74,6 +74,33 @@ class AsmJSMicro(Benchmark): tests.append({ 'name': '__total__', 'time': total }) return tests +class AsmJSApps(Benchmark): + def __init__(self): + super(AsmJSApps, self).__init__('asmjs-apps', 'asmjs-apps') + + def benchmark(self, shell, env, args): + full_args = ['python', 'harness.py', shell, '--'] + args + print(' '.join(full_args)) + + p = subprocess.Popen(full_args, stdout=subprocess.PIPE, env=env) + output = p.communicate()[0] + print(output) + return self.parse(output) + + def parse(self, output): + total = 0.0 + tests = [] + for line in output.splitlines(): + m = re.search("(.+) - (\d+(\.\d+)?)", line) + if not m: + continue + name = m.group(1) + score = m.group(2) + total += float(score) + tests.append({ 'name': name, 'time': score }) + tests.append({ 'name': '__total__', 'time': total }) + return tests + class Octane(Benchmark): def __init__(self): super(Octane, self).__init__('octane', 'octane') @@ -157,5 +184,6 @@ Benchmarks = [AsmJSMicro(), SunSpider('ss', 'SunSpider', 'sunspider-0.9.1', 20), SunSpider('kraken', 'kraken', 'kraken-1.1', 5), SunSpider('misc', 'Assorted', 'assorted', 3), - Octane() + Octane(), + AsmJSApps(), ]