Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
3ddfe2e7
Commit
3ddfe2e7
authored
Feb 08, 2001
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Use a cStringIO instance instead of a dumy file.
- Rearrange pickle imports.
parent
c3a2e1fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
lib/python/TAL/timer.py
lib/python/TAL/timer.py
+7
-5
No files found.
lib/python/TAL/timer.py
View file @
3ddfe2e7
...
...
@@ -90,7 +90,8 @@ Helper program to time TALVisitor and other DOM tree operations.
import
sys
import
time
import
getopt
import
cPickle
from
cPickle
import
dumps
,
loads
from
cStringIO
import
StringIO
from
driver
import
parsefile
,
copytree
,
talizetree
,
printtree
,
FILE
from
driver
import
compiletree
,
interpretit
...
...
@@ -110,13 +111,14 @@ def main():
file
=
args
[
0
]
else
:
file
=
FILE
dummyfile
=
StringIO
()
doc
=
timefunc
(
count
,
parsefile
,
file
)
doc
=
timefunc
(
count
,
copytree
,
doc
)
doc2
=
timefunc
(
count
,
talizetree
,
doc
)
timefunc
(
count
,
printtree
,
doc
,
open
(
"/dev/null"
,
"w"
)
)
timefunc
(
count
,
printtree
,
doc
,
dummyfile
)
timefunc
(
count
,
macroIndexer
,
doc
)
it
=
timefunc
(
count
,
compiletree
,
doc
)
timefunc
(
count
,
interpretit
,
it
,
None
,
open
(
"/dev/null"
,
"w"
)
)
timefunc
(
count
,
interpretit
,
it
,
None
,
dummyfile
)
s
=
timefunc
(
count
,
pickletree
,
doc
)
timefunc
(
count
,
unpickletree
,
s
)
...
...
@@ -132,10 +134,10 @@ def timefunc(count, func, *args):
return
result
def
pickletree
(
doc
):
return
cPickle
.
dumps
(
doc
)
return
dumps
(
doc
)
def
unpickletree
(
s
):
return
cPickle
.
loads
(
s
)
return
loads
(
s
)
if
__name__
==
"__main__"
:
main
()
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