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
4411108b
Commit
4411108b
authored
Jun 03, 2015
by
Kevin Modzelewski
Committed by
Kevin Modzelewski
Jun 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more benchmarks
parent
6a6d049c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
microbenchmarks/contains_ubench.py
microbenchmarks/contains_ubench.py
+6
-0
microbenchmarks/oldstyle_class_ubench.py
microbenchmarks/oldstyle_class_ubench.py
+45
-0
No files found.
microbenchmarks/contains_ubench.py
0 → 100644
View file @
4411108b
def
f
():
S
=
set
(
"abc"
)
c
=
"b"
for
i
in
xrange
(
5000000
):
c
in
S
f
()
microbenchmarks/oldstyle_class_ubench.py
0 → 100644
View file @
4411108b
# This is the string tokenizer.PseudoToken:
pattern
=
'[
\
\
f
\
\
t]*((
\
\
\
\
\
\
r?
\
\
n|
\
\
Z|#[^
\
\
r
\
\
n]*|([uUbB]?[rR]?
\
'
\
'
\
'
|[uUbB]?[rR]?"""))|((
\
\
d+[jJ]|((
\
\
d+
\
\
.
\
\
d*|
\
\
.
\
\
d+)([eE][-+]?
\
\
d+)?|
\
\
d+[eE][-+]?
\
\
d+)[jJ])|((
\
\
d+
\
\
.
\
\
d*|
\
\
.
\
\
d+)([eE][-+]?
\
\
d+)?|
\
\
d+[eE][-+]?
\
\
d+)|(0[xX][
\
\
da-fA-F]+[lL]?|0[bB][01]+[lL]?|(0[oO][0-7]+)|(0[0-7]*)[lL]?|[1-9]
\
\
d*[lL]?))|((
\
\
*
\
\
*=?|>>=?|<<=?|<>|!=|//=?|[+
\
\
-*/%&|^=<>]=?|~)|[][(){}]|(
\
\
r?
\
\
n|[:;.,`@]))|([uUbB]?[rR]?
\
'
[^
\
\
n
\
'
\
\
\
\
]*(?:
\
\
\
\
.[^
\
\
n
\
'
\
\
\
\
]*)*(
\
'
|
\
\
\
\
\
\
r?
\
\
n)|[uUbB]?[rR]?"[^
\
\
n"
\
\
\
\
]*(?:
\
\
\
\
.[^
\
\
n"
\
\
\
\
]*)*("|
\
\
\
\
\
\
r?
\
\
n))|[a-zA-Z_]
\
\
w*)'
class
Tokenizer
:
def
__init__
(
self
,
string
):
self
.
string
=
string
self
.
index
=
0
self
.
__next
()
def
__next
(
self
):
if
self
.
index
>=
len
(
self
.
string
):
self
.
next
=
None
return
char
=
self
.
string
[
self
.
index
]
if
char
[
0
]
==
"
\
\
"
:
try
:
c
=
self
.
string
[
self
.
index
+
1
]
except
IndexError
:
raise
error
,
"bogus escape (end of line)"
char
=
char
+
c
self
.
index
=
self
.
index
+
len
(
char
)
self
.
next
=
char
def
match
(
self
,
char
,
skip
=
1
):
if
char
==
self
.
next
:
if
skip
:
self
.
__next
()
return
1
return
0
def
get
(
self
):
this
=
self
.
next
self
.
__next
()
return
this
def
tell
(
self
):
return
self
.
index
,
self
.
next
def
seek
(
self
,
index
):
self
.
index
,
self
.
next
=
index
for
i
in
xrange
(
1000
):
t
=
Tokenizer
(
pattern
)
for
j
in
xrange
(
500
):
t
.
_Tokenizer__next
()
# n = t.get()
# if not n:
# break
# sre_parse.parse(pattern, 0)
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