Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
fa1b27b5
Commit
fa1b27b5
authored
Aug 20, 2014
by
dbarbera
Browse files
Extend benchmark summary
parent
b0421901
Changes
2
Show whitespace changes
Inline
Side-by-side
setup.py
View file @
fa1b27b5
...
...
@@ -19,7 +19,12 @@ setup(
author_email
=
'maxime.perrotin@esa.int'
,
description
=
'A tiny, free SDL editor for TASTE'
,
long_description
=
open
(
'README.md'
).
read
(),
install_requires
=
[
'antlr_python_runtime'
,
'pygraphviz'
,
'singledispatch'
],
install_requires
=
[
'antlr_python_runtime'
,
'pygraphviz'
,
'singledispatch'
,
],
tests_require
=
[
'tabulate'
],
include_package_data
=
True
,
url
=
'http://opengeode.net'
,
classifiers
=
[
...
...
@@ -28,9 +33,9 @@ setup(
'Operating System :: OS Independent'
,
'Programming Language :: Python :: 2.7'
],
entry_points
=
{
entry_points
=
{
'console_scripts'
:
[
'opengeode = opengeode.opengeode:opengeode'
]
},
)
)
tests/regression/benchmark.py
View file @
fa1b27b5
...
...
@@ -3,6 +3,8 @@ import subprocess
import
sys
import
time
as
t
from
tabulate
import
tabulate
def
main
():
start
=
t
.
time
()
...
...
@@ -37,6 +39,7 @@ def benchmark(testfolder):
return
result
=
{
"name"
:
testfolder
[:
-
1
],
"size"
:
{
"ada"
:
os
.
path
.
getsize
(
llvm_bin
),
"llvm"
:
os
.
path
.
getsize
(
ada_bin
),
...
...
@@ -64,16 +67,28 @@ def summarize(results, errors, elapsed):
print
"No results"
return
1
print
"Summary:"
print
" Size: Ada %.2f%% LLVM %.2f%%"
%
diff
(
results
,
"size"
)
print
" Time: Ada %.2f%% LLVM %.2f%%"
%
diff
(
results
,
"time"
)
print
"Summary"
print
"-------"
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
def
diff
(
results
,
metric
):
metrics
=
[
r
[
metric
]
for
r
in
results
]
return
100
,
mean
(([
float
(
m
[
"llvm"
])
/
float
(
m
[
"ada"
])
*
100
for
m
in
metrics
]))
def
diff
(
results
):
return
100
,
mean
(([
float
(
r
[
"llvm"
])
/
float
(
r
[
"ada"
])
*
100
for
r
in
results
]))
def
mean
(
values
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment