Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
ZEO
Commits
6f7f22cf
Commit
6f7f22cf
authored
Jul 01, 2000
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added control over whether loads are included. Loads are not
included unless the -L option is provided.
parent
c91b10a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
src/ZODB/test/speed.py
src/ZODB/test/speed.py
+16
-3
No files found.
src/ZODB/test/speed.py
View file @
6f7f22cf
...
...
@@ -15,6 +15,9 @@ Options:
-z Test compressing data
-D Run in debug mode
-L Test loads as well as stores by minimizing
the cache after eachrun
"""
import
sys
,
os
,
getopt
,
string
,
time
...
...
@@ -27,10 +30,11 @@ class P(Persistence.Persistent): pass
def
main
(
args
):
opts
,
args
=
getopt
.
getopt
(
args
,
'zd:n:Ds:'
)
opts
,
args
=
getopt
.
getopt
(
args
,
'zd:n:Ds:
M
'
)
z
=
s
=
None
data
=
sys
.
argv
[
0
]
nrep
=
5
minimize
=
0
for
o
,
v
in
opts
:
if
o
==
'-n'
:
nrep
=
string
.
atoi
(
v
)
elif
o
==
'-d'
:
data
=
v
...
...
@@ -39,6 +43,7 @@ def main(args):
global
zlib
import
zlib
z
=
compress
elif
o
==
'-M'
:
minimize
=
1
elif
o
==
'-D'
:
global
debug
os
.
environ
[
'STUPID_LOG_FILE'
]
=
''
...
...
@@ -53,7 +58,10 @@ def main(args):
s
=
ZODB
.
FileStorage
.
FileStorage
(
'zeo_speed.fs'
,
create
=
1
)
data
=
open
(
data
).
read
()
db
=
ZODB
.
DB
(
s
)
db
=
ZODB
.
DB
(
s
,
# disable cache deactivation
cache_size
=
4000
,
cache_deactivate_after
=
6000
,)
results
=
{}
for
j
in
range
(
nrep
):
...
...
@@ -75,7 +83,12 @@ def main(args):
jar
.
close
()
sys
.
stderr
.
write
(
"%s %s %s
\
n
"
%
(
j
,
r
,
time
.
time
()
-
t
))
sys
.
stdout
.
flush
()
rt
=
d
=
p
=
v
=
None
# release all references
if
minimize
:
time
.
sleep
(
3
)
jar
.
cacheMinimize
(
3
)
def
compress
(
s
):
c
=
zlib
.
compressobj
()
...
...
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