Merge branch 'master' of https://github.com/dvander/arewefastyet
This commit is contained in:
Коммит
535ae4fbbc
|
@ -18,8 +18,14 @@ class Benchmark(object):
|
|||
with utils.chdir(self.folder):
|
||||
return self._run(submit, native, modes)
|
||||
|
||||
def omit(self, mode):
|
||||
if mode.name == 'noasmjs':
|
||||
return True
|
||||
|
||||
def _run(self, submit, native, modes):
|
||||
for mode in modes:
|
||||
if self.omit(mode):
|
||||
continue
|
||||
try:
|
||||
tests = None
|
||||
print('Running ' + self.name + ' under ' + mode.shell + ' ' + ' '.join(mode.args))
|
||||
|
@ -34,6 +40,11 @@ class AsmJSMicro(Benchmark):
|
|||
def __init__(self):
|
||||
super(AsmJSMicro, self).__init__('asmjs-ubench', 'asmjs-ubench')
|
||||
|
||||
def omit(self, mode):
|
||||
if mode.name == 'noasmjs':
|
||||
return False
|
||||
return super(AsmJSMicro, self).omit(mode)
|
||||
|
||||
def _run(self, submit, native, modes):
|
||||
# Run the C++ mode.
|
||||
full_args = ['python', 'harness.py', '--native']
|
||||
|
@ -74,6 +85,38 @@ 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 omit(self, mode):
|
||||
if mode.name == 'noasmjs':
|
||||
return False
|
||||
return super(AsmJSApps, self).omit(mode)
|
||||
|
||||
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 +200,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(),
|
||||
]
|
||||
|
|
|
@ -176,18 +176,12 @@ class MozillaInbound(Mozilla):
|
|||
{
|
||||
'mode': 'jmim',
|
||||
'args': ['--ion-parallel-compile=on', '--no-jm', '-W']
|
||||
},
|
||||
{
|
||||
'mode': 'noasmjs',
|
||||
'args': ['--ion-parallel-compile=on', '--no-jm', '-W', '--no-asmjs']
|
||||
}
|
||||
]
|
||||
|
||||
class MozillaBaselineCompiler(Mozilla):
|
||||
def __init__(self, conf):
|
||||
super(MozillaBaselineCompiler, self).__init__(conf, 'bc')
|
||||
self.modes = [
|
||||
{
|
||||
'mode': 'bc',
|
||||
'args': ['--ion', '--no-jm', '-n', '--ion-parallel-compile=on']
|
||||
}
|
||||
]
|
||||
|
||||
class NativeCompiler(Engine):
|
||||
def __init__(self, conf):
|
||||
|
|
Загрузка…
Ссылка в новой задаче