Commit e83d9285 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Merge pull request #21 from dbrabera/extended_benchmark_summary

Extend benchmark summary
parents b0421901 fa1b27b5
...@@ -12,25 +12,30 @@ from setuptools import setup, find_packages ...@@ -12,25 +12,30 @@ from setuptools import setup, find_packages
import opengeode import opengeode
setup( setup(
name='opengeode', name='opengeode',
version=opengeode.__version__, version=opengeode.__version__,
packages=find_packages(), packages=find_packages(),
author='Maxime Perrotin', author='Maxime Perrotin',
author_email='maxime.perrotin@esa.int', author_email='maxime.perrotin@esa.int',
description='A tiny, free SDL editor for TASTE', description='A tiny, free SDL editor for TASTE',
long_description=open('README.md').read(), long_description=open('README.md').read(),
install_requires=['antlr_python_runtime', 'pygraphviz', 'singledispatch'], install_requires=[
include_package_data=True, 'antlr_python_runtime',
url='http://opengeode.net', 'pygraphviz',
classifiers=[ 'singledispatch',
'Programming Language :: Python', ],
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)', tests_require=['tabulate'],
'Operating System :: OS Independent', include_package_data=True,
'Programming Language :: Python :: 2.7' url='http://opengeode.net',
], classifiers=[
entry_points= { 'Programming Language :: Python',
'console_scripts': [ 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
'opengeode = opengeode.opengeode:opengeode' 'Operating System :: OS Independent',
] 'Programming Language :: Python :: 2.7'
}, ],
) entry_points={
'console_scripts': [
'opengeode = opengeode.opengeode:opengeode'
]
},
)
...@@ -3,6 +3,8 @@ import subprocess ...@@ -3,6 +3,8 @@ import subprocess
import sys import sys
import time as t import time as t
from tabulate import tabulate
def main(): def main():
start = t.time() start = t.time()
...@@ -37,6 +39,7 @@ def benchmark(testfolder): ...@@ -37,6 +39,7 @@ def benchmark(testfolder):
return return
result = { result = {
"name": testfolder[:-1],
"size": { "size": {
"ada": os.path.getsize(llvm_bin), "ada": os.path.getsize(llvm_bin),
"llvm": os.path.getsize(ada_bin), "llvm": os.path.getsize(ada_bin),
...@@ -64,16 +67,28 @@ def summarize(results, errors, elapsed): ...@@ -64,16 +67,28 @@ def summarize(results, errors, elapsed):
print "No results" print "No results"
return 1 return 1
print "Summary:" print "Summary"
print " Size: Ada %.2f%% LLVM %.2f%%" % diff(results, "size") print "-------"
print " Time: Ada %.2f%% LLVM %.2f%%" % diff(results, "time") print ""
print "Size: Ada %.2f%% LLVM %.2f%%" % diff([r["size"] for r in results])
print "Time: Ada %.2f%% LLVM %.2f%%" % diff([r["time"] for r in results])
print ""
headers = ["Benchmark", "Ada size", "LLVM size", "Ada time", "LLVM time"]
table = []
for result in results:
row = [result["name"]]
row.extend(diff([result["size"]]))
row.extend(diff([result["time"]]))
table.append(row)
print tabulate(table, headers, tablefmt="orgtbl", floatfmt=".2f")
return 0 if results and not errors else 1 return 0 if results and not errors else 1
def diff(results, metric): def diff(results):
metrics = [r[metric] for r in results] return 100, mean(([float(r["llvm"]) / float(r["ada"]) * 100 for r in results]))
return 100, mean(([float(m["llvm"]) / float(m["ada"]) * 100 for m in metrics]))
def mean(values): def mean(values):
......
Supports Markdown
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