Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
72aca8d6
Commit
72aca8d6
authored
Nov 07, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
These scripts have moved to the pyston_perf repo
parent
b82fd22e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
141 deletions
+0
-141
tools/measure_perf.py
tools/measure_perf.py
+0
-84
tools/submit.py
tools/submit.py
+0
-57
No files found.
tools/measure_perf.py
deleted
100644 → 0
View file @
b82fd22e
#!/usr/bin/env python
import
commands
import
os.path
import
subprocess
import
time
import
submit
def
run_tests
(
executables
,
benchmarks
,
callback
):
times
=
[[]
for
e
in
executables
]
for
b
in
benchmarks
:
for
e
,
time_list
in
zip
(
executables
,
times
):
start
=
time
.
time
()
subprocess
.
check_call
(
e
.
args
+
[
b
],
stdout
=
open
(
"/dev/null"
,
'w'
))
elapsed
=
time
.
time
()
-
start
print
"%s %s: % 4.1fs"
%
(
e
.
name
.
rjust
(
15
),
b
.
ljust
(
35
),
elapsed
)
time_list
.
append
(
elapsed
)
if
callback
:
callback
(
e
,
b
,
elapsed
)
for
e
,
time_list
in
zip
(
executables
,
times
):
t
=
1
for
elapsed
in
time_list
:
t
*=
elapsed
t
**=
(
1.0
/
len
(
time_list
))
print
"%s %s: % 4.1fs"
%
(
e
.
name
.
rjust
(
15
),
"geomean"
.
ljust
(
35
),
t
)
class
Executable
(
object
):
def
__init__
(
self
,
args
,
name
):
self
.
args
=
args
self
.
name
=
name
def
main
():
executables
=
[
Executable
([
"./pyston_release"
,
"-q"
],
"pyston"
)]
RUN_CPYTHON
=
0
if
RUN_CPYTHON
:
executables
.
append
(
Executable
([
"python"
],
"cpython 2.7"
))
DO_SUBMIT
=
1
# if RUN_PYPY:
# executables.append(Executable(["python"], "cpython 2.7"))
benchmarks
=
[]
benchmarks
+=
[
"../microbenchmarks/%s"
%
s
for
s
in
[
]]
benchmarks
+=
[
"../minibenchmarks/%s"
%
s
for
s
in
[
"fannkuch_med.py"
,
"nbody_med.py"
,
"interp2.py"
,
"raytrace.py"
,
"chaos.py"
,
"nbody.py"
,
"fannkuch.py"
,
"spectral_norm.py"
,
]]
GIT_REV
=
commands
.
getoutput
(
"git rev-parse HEAD"
)
def
submit_callback
(
exe
,
benchmark
,
elapsed
):
benchmark
=
os
.
path
.
basename
(
benchmark
)
assert
benchmark
.
endswith
(
".py"
)
benchmark
=
benchmark
[:
-
3
]
commitid
=
GIT_REV
if
"cpython"
in
exe
.
name
:
commitid
=
"default"
submit
.
submit
(
commitid
=
commitid
,
benchmark
=
benchmark
,
executable
=
exe
.
name
,
value
=
elapsed
)
callback
=
None
if
DO_SUBMIT
:
callback
=
submit_callback
run_tests
(
executables
,
benchmarks
,
callback
)
if
__name__
==
"__main__"
:
main
()
tools/submit.py
deleted
100644 → 0
View file @
b82fd22e
# Submission library based on the codespeed example:
from
datetime
import
datetime
import
socket
import
urllib
import
urllib2
# You need to enter the real URL and have the server running
CODESPEED_URL
=
'http://speed.pyston.org/'
def
_formdata
(
commitid
,
benchmark
,
executable
,
value
):
hostname
=
socket
.
gethostname
()
if
"cpython"
in
executable
.
lower
():
project
=
"CPython"
else
:
project
=
"Pyston"
# Mandatory fields
data
=
{
'commitid'
:
commitid
,
'branch'
:
'default'
,
# Always use default for trunk/master/tip
'project'
:
project
,
'executable'
:
executable
,
'benchmark'
:
benchmark
,
'environment'
:
hostname
,
'result_value'
:
value
,
}
"""
# Optional fields
current_date = datetime.today()
data.update({
'revision_date': current_date, # Optional. Default is taken either
# from VCS integration or from current date
'result_date': current_date, # Optional, default is current date
})
"""
return
data
def
submit
(
commitid
,
benchmark
,
executable
,
value
):
data
=
_formdata
(
commitid
,
benchmark
,
executable
,
value
)
params
=
urllib
.
urlencode
(
data
)
response
=
"None"
print
"Saving result for executable %s, revision %s, benchmark %s"
%
(
data
[
'executable'
],
data
[
'commitid'
],
data
[
'benchmark'
])
try
:
f
=
urllib2
.
urlopen
(
CODESPEED_URL
+
'result/add/'
,
params
)
except
urllib2
.
HTTPError
as
e
:
print
str
(
e
)
print
e
.
read
()
raise
response
=
f
.
read
()
f
.
close
()
print
"Server (%s) response: %s
\
n
"
%
(
CODESPEED_URL
,
response
)
Write
Preview
Markdown
is supported
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