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
f771d5a5
Commit
f771d5a5
authored
Nov 09, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
microbenchmarks for the presentation
parent
14aa0f0a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
147 additions
and
1 deletion
+147
-1
microbenchmarks/control_flow_ubench.py
microbenchmarks/control_flow_ubench.py
+35
-0
microbenchmarks/django_template3_reduced.py
microbenchmarks/django_template3_reduced.py
+1
-1
microbenchmarks/megamorphic_control_flow.py
microbenchmarks/megamorphic_control_flow.py
+50
-0
microbenchmarks/megamorphic_ubench.py
microbenchmarks/megamorphic_ubench.py
+23
-0
microbenchmarks/tester.py
microbenchmarks/tester.py
+38
-0
No files found.
microbenchmarks/control_flow_ubench.py
0 → 100644
View file @
f771d5a5
N
=
1024
def
f
(
n
):
l
=
[]
assert
N
%
n
==
0
while
len
(
l
)
<
N
:
l
+=
range
(
n
)
t
=
0
for
_
in
xrange
(
2000
):
for
i
in
l
:
if
i
&
1
:
t
+=
1
else
:
t
+=
2
if
i
&
2
:
t
+=
1
else
:
t
+=
2
if
i
&
4
:
t
+=
1
else
:
t
+=
2
if
i
&
8
:
t
+=
1
else
:
t
+=
2
if
i
&
16
:
t
+=
1
else
:
t
+=
2
if
i
&
32
:
t
+=
1
else
:
t
+=
2
if
i
&
64
:
t
+=
1
else
:
t
+=
2
if
i
&
128
:
t
+=
1
else
:
t
+=
2
if
i
&
256
:
t
+=
1
else
:
t
+=
2
if
i
&
512
:
t
+=
1
else
:
t
+=
2
# print t
import
sys
f
(
int
(
sys
.
argv
[
1
]))
microbenchmarks/django_template3_reduced.py
View file @
f771d5a5
import
os
import
sys
sys
.
path
.
append
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"../test/
testsuite/
lib/django"
))
sys
.
path
.
append
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"../test/lib/django"
))
BENCHMARK_SUITE_DIR
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"../../pyston-perf/benchmarking/benchmark_suite"
)
sys
.
path
.
extend
([
os
.
path
.
join
(
BENCHMARK_SUITE_DIR
,
"django_template2_site"
)])
...
...
microbenchmarks/megamorphic_control_flow.py
0 → 100644
View file @
f771d5a5
M
=
64
N
=
64
def
f
(
m
,
n
):
assert
N
%
n
==
0
assert
M
%
m
==
0
l1
=
[]
for
i
in
xrange
(
m
):
class
C
(
object
):
pass
c
=
C
()
c
.
x
=
i
l1
.
append
(
c
)
lm
=
[]
while
len
(
lm
)
<
M
:
lm
+=
l1
ln
=
[]
while
len
(
ln
)
<
N
:
ln
+=
range
(
n
)
t
=
0
for
_
in
xrange
(
400
):
for
i
in
ln
:
for
o
in
lm
:
if
i
&
1
:
t
+=
o
.
x
else
:
t
-=
o
.
x
if
i
&
2
:
t
+=
o
.
x
else
:
t
-=
o
.
x
if
i
&
4
:
t
+=
o
.
x
else
:
t
-=
o
.
x
if
i
&
8
:
t
+=
o
.
x
else
:
t
-=
o
.
x
if
i
&
16
:
t
+=
o
.
x
else
:
t
-=
o
.
x
if
i
&
32
:
t
+=
o
.
x
else
:
t
-=
o
.
x
if
i
&
64
:
t
+=
o
.
x
else
:
t
-=
o
.
x
if
i
&
128
:
t
+=
o
.
x
else
:
t
-=
o
.
x
if
i
&
256
:
t
+=
o
.
x
else
:
t
-=
o
.
x
if
i
&
512
:
t
+=
o
.
x
else
:
t
-=
o
.
x
# print t
import
sys
f
(
int
(
sys
.
argv
[
1
]),
int
(
sys
.
argv
[
2
]))
microbenchmarks/megamorphic_ubench.py
0 → 100644
View file @
f771d5a5
N
=
1024
def
f
(
n
):
l
=
[]
assert
N
%
n
==
0
l2
=
[]
for
i
in
xrange
(
n
):
class
C
(
object
):
pass
c
=
C
()
c
.
x
=
i
l2
.
append
(
c
)
while
len
(
l
)
<
N
:
l
+=
l2
t
=
0
for
_
in
xrange
(
20000
):
for
o
in
l
:
t
+=
o
.
x
import
sys
f
(
int
(
sys
.
argv
[
1
]))
microbenchmarks/tester.py
0 → 100644
View file @
f771d5a5
import
os
import
subprocess
import
time
EXECUTABLES
=
[
'python'
,
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'../pyston_pgo'
),
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'../../pyston_related/pypy-4.0.0-linux64/bin/pypy'
)
]
BENCHMARKS
=
[
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'megamorphic_control_flow.py'
)
]
ARGS
=
[[
str
(
2
**
i
),
"16"
]
for
i
in
xrange
(
0
,
7
)]
BENCHMARKS
=
[
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'control_flow_ubench.py'
),
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'megamorphic_ubench.py'
)
]
ARGS
=
[[
str
(
2
**
i
)]
for
i
in
xrange
(
0
,
10
)]
NRUNS
=
3
for
b
in
BENCHMARKS
:
print
os
.
path
.
basename
(
b
)
for
args
in
ARGS
:
print
' '
.
join
(
args
)
for
exe
in
EXECUTABLES
:
print
os
.
path
.
basename
(
exe
)
for
args
in
ARGS
:
best
=
float
(
'inf'
)
for
_
in
xrange
(
NRUNS
):
start
=
time
.
time
()
subprocess
.
check_call
([
exe
,
b
]
+
args
)
elapsed
=
time
.
time
()
-
start
best
=
min
(
best
,
elapsed
)
print
best
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