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
6a6dc30e
Commit
6a6dc30e
authored
9 years ago
by
Kevin Modzelewski
Committed by
Kevin Modzelewski
9 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Misc tools+microbenchmarks
parent
8ceb2254
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
0 deletions
+71
-0
microbenchmarks/oldstyle_class_ubench.py
microbenchmarks/oldstyle_class_ubench.py
+12
-0
microbenchmarks/str_comparison_ubench.py
microbenchmarks/str_comparison_ubench.py
+15
-0
tools/check_stats.py
tools/check_stats.py
+44
-0
No files found.
microbenchmarks/oldstyle_class_ubench.py
View file @
6a6dc30e
...
...
@@ -43,3 +43,15 @@ for i in xrange(1000):
# if not n:
# break
# sre_parse.parse(pattern, 0)
class
C
:
pass
c
=
C
()
c
.
a
=
1
def
f
(
c
):
n
=
10000000
while
n
:
c
.
a
f
(
c
)
This diff is collapsed.
Click to expand it.
microbenchmarks/str_comparison_ubench.py
0 → 100644
View file @
6a6dc30e
def
f
():
i
=
0
n
=
10000000
s1
=
""
s2
=
""
while
i
<
n
:
i
=
i
+
1
s1
<
s2
s1
<=
s2
s1
>
s2
s1
>=
s2
s1
==
s2
s1
!=
s2
f
()
This diff is collapsed.
Click to expand it.
tools/check_stats.py
0 → 100644
View file @
6a6dc30e
import
argparse
import
os
import
subprocess
import
sys
import
time
if
__name__
==
"__main__"
:
cmd
=
[
"./pyston_release"
,
"-Ts"
,
sys
.
argv
[
1
]]
start
=
time
.
time
()
p
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
out
,
err
=
p
.
communicate
()
assert
p
.
wait
()
==
0
elapsed
=
time
.
time
()
-
start
open
(
'tmp.txt'
,
'w'
).
write
(
out
)
# elapsed = 1.5
# out = open("tmp.txt").read()
stats
=
[]
is_counter
=
False
for
l
in
out
.
split
(
'
\
n
'
):
if
l
.
strip
()
==
"Counters:"
:
is_counter
=
True
continue
if
l
.
strip
()
==
"(End of stats)"
:
is_counter
=
False
continue
if
not
is_counter
:
continue
name
,
count
=
l
.
split
(
':'
)
count
=
int
(
count
)
if
name
.
startswith
(
'us_timer'
):
stats
.
append
((
name
,
0.000001
*
count
))
# if name.startswith('slowpath'):
# stats.append((name, 0.0000001 * count))
stats
.
sort
(
key
=
lambda
(
name
,
s
):
s
,
reverse
=
True
)
print
"Most interesting stats:"
for
(
name
,
s
)
in
stats
[:
10
]:
print
"% 40s %.3fs (%.0f%%)"
%
(
name
,
s
,
100.0
*
s
/
elapsed
)
print
"%.1fs total time"
%
elapsed
This diff is collapsed.
Click to expand it.
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