WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

Commit cc8c8a7e authored by John Zhang's avatar John Zhang
Browse files

include slowdown in result dictionary

parent 27013485
......@@ -139,11 +139,12 @@ def get_stat_compiled(compile_fnc, config, iterations=100):
def get_display_str(stat):
output = "average: %(average)s\n" \
"min: %(t_min)s\n" \
"max: %(t_max)s\n" \
"std_dev: %(std_dev)s\n"
return output % stat
output = "average: {average:.6f}\n" \
"min: {t_min:.6f}\n" \
"max: {t_max:.6f}\n" \
"std_dev: {std_dev:.6f}\n" \
"slowdown: {slowdown:.3f}x\n"
return output.format(**stat)
def perf(config, iterations):
......@@ -158,6 +159,10 @@ def perf(config, iterations):
if config['mu_build_fnc']:
results['mu'] = get_stat_compiled(compile_mu, config, iterations)
baseline_target = 'c'
for python, result in results.items():
result['slowdown'] = result['average'] / results[baseline_target]['average']
for python, result in results.items():
print '\033[35m---- %(python)s ----\033[0m' % locals()
print get_display_str(result)
......@@ -269,15 +274,15 @@ def perf_quicksort(N, iterations):
def test_functional_fibonacci():
save_results('fibonacci', perf_fibonacci(5, 1))
perf_fibonacci(5, 1)
def test_functional_arraysum():
save_results('arraysum', perf_arraysum(100, 1))
perf_arraysum(100, 1)
def test_functional_quicksort():
save_results('quicksort', perf_quicksort(100, 5))
perf_quicksort(100, 5)
if __name__ == '__main__':
import sys
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment