Commit 6f7f22cf authored by Jim Fulton's avatar Jim Fulton

Added control over whether loads are included. Loads are not

included unless the -L option is provided.
parent c91b10a4
...@@ -15,6 +15,9 @@ Options: ...@@ -15,6 +15,9 @@ Options:
-z Test compressing data -z Test compressing data
-D Run in debug mode -D Run in debug mode
-L Test loads as well as stores by minimizing
the cache after eachrun
""" """
import sys, os, getopt, string, time import sys, os, getopt, string, time
...@@ -27,10 +30,11 @@ class P(Persistence.Persistent): pass ...@@ -27,10 +30,11 @@ class P(Persistence.Persistent): pass
def main(args): def main(args):
opts, args = getopt.getopt(args, 'zd:n:Ds:') opts, args = getopt.getopt(args, 'zd:n:Ds:M')
z=s=None z=s=None
data=sys.argv[0] data=sys.argv[0]
nrep=5 nrep=5
minimize=0
for o, v in opts: for o, v in opts:
if o=='-n': nrep=string.atoi(v) if o=='-n': nrep=string.atoi(v)
elif o=='-d': data=v elif o=='-d': data=v
...@@ -39,6 +43,7 @@ def main(args): ...@@ -39,6 +43,7 @@ def main(args):
global zlib global zlib
import zlib import zlib
z=compress z=compress
elif o=='-M': minimize=1
elif o=='-D': elif o=='-D':
global debug global debug
os.environ['STUPID_LOG_FILE']='' os.environ['STUPID_LOG_FILE']=''
...@@ -53,7 +58,10 @@ def main(args): ...@@ -53,7 +58,10 @@ def main(args):
s=ZODB.FileStorage.FileStorage('zeo_speed.fs', create=1) s=ZODB.FileStorage.FileStorage('zeo_speed.fs', create=1)
data=open(data).read() data=open(data).read()
db=ZODB.DB(s) db=ZODB.DB(s,
# disable cache deactivation
cache_size=4000,
cache_deactivate_after=6000,)
results={} results={}
for j in range(nrep): for j in range(nrep):
...@@ -75,7 +83,12 @@ def main(args): ...@@ -75,7 +83,12 @@ def main(args):
jar.close() jar.close()
sys.stderr.write("%s %s %s\n" % (j, r, time.time()-t)) sys.stderr.write("%s %s %s\n" % (j, r, time.time()-t))
sys.stdout.flush() sys.stdout.flush()
rt=d=p=v=None # release all references
if minimize:
time.sleep(3)
jar.cacheMinimize(3)
def compress(s): def compress(s):
c=zlib.compressobj() c=zlib.compressobj()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment