# for f in [_encode_file_not_really, _encode_file_not_really_and_hash, _encode_file, _encode_file_and_hash,]:
# for f in [_encode_data_not_really, _encode_data_easyfec, _encode_data_fec,]:
for f in [_encode_data_fec,]:
- print f
- benchutil.bench(f, initfunc=_make_new_rand_data, TOPXP=24, MAXREPS=256, MAXTIME=64)
+ for BSIZE in [2**22]:
+ benchutil.rep_bench(f, n=BSIZE, initfunc=_make_new_rand_data, MAXREPS=64, MAXTIME=None)
bench()
url='http://allmydata.org/trac/'+PKG,
license='GNU GPL',
dependency_links=dependency_links,
- install_requires=["argparse >= 0.8", "pyutil >= 1.3.5"],
- tests_require=["pyutil >= 1.3.5"],
+ install_requires=["argparse >= 0.8", "pyutil >= 1.3.19"],
+ tests_require=["pyutil >= 1.3.19"],
packages=find_packages(),
include_package_data=True,
data_files=data_files,
--- /dev/null
+#!/bin/bash
+
+/bin/rm -rf ./benchresults
+mkdir benchresults
+STRIDE=32
+while [ $(( $STRIDE < 32769 )) ] ; do
+ /bin/rm -rf build
+ rm zfec/_fec.so
+ /bin/rm -rf instdir
+ mkdir instdir
+ PYTHONPATH=instdir ./setup.py develop --install-dir=instdir --stride=${STRIDE} >/dev/null
+ echo $STRIDE
+ PYTHONPATH=instdir python -OO ./bench/bench_zfec.py >> benchresults/comp_0-stride_$STRIDE
+ tail -1 benchresults/comp_0-stride_$STRIDE
+ STRIDE=$(( $STRIDE + 32 ))
+done
--- /dev/null
+#!/usr/bin/env python
+
+import bisect, random, os, re
+
+from pyutil import fileutil
+
+assert not os.path.exists("benchresults")
+
+os.mkdir("benchresults")
+
+MIN=512
+MAX=1024
+
+results = {}
+
+R=re.compile("ave rate: ([1-9][0-9]*)")
+
+def measure(stride):
+ fileutil.rm_dir("build")
+ fileutil.rm_dir("instdir")
+ fileutil.remove_if_possible(os.path.join("zfec", "_fec.so"))
+ fileutil.make_dirs("instdir")
+ fname = os.path.join("benchresults", "comp_0-stride_%d"%stride)
+ os.system("PYTHONPATH=instdir ./setup.py develop --install-dir=instdir --stride=%d >/dev/null" % stride)
+ os.system("PYTHONPATH=instdir python -OO ./bench/bench_zfec.py >> %s" % fname)
+ inf = open(fname, "rU")
+ for l in inf:
+ m = R.search(l)
+ if m:
+ result = int(m.group(1))
+ if results.has_key(stride):
+ print "stride: %d, results: %d (dup %d)" % (stride, result, results[stride])
+ else:
+ print "stride: %d, results: %d" % (stride, result)
+ results[stride] = result
+ break
+
+measure(MIN)
+measure(MAX)
+
+while True:
+ stride = random.randrange(MIN, MAX+1)
+ measure(stride)
--- /dev/null
+#!/bin/bash
+
+DAT=stridetune.dat
+rm -f $DAT
+for F in benchresults/comp_0-stride_*; do
+ NUM=${F:27}
+ for M in `grep "^N: " benchresults/comp_0-stride_$NUM | cut -d':' -f10-` ; do
+ echo "$NUM $M" >> $DAT
+ done
+done
--- /dev/null
+#!/usr/bin/env python
+
+from pyx import *
+def g(f):
+ g=graph.graphxy(width=16, x=graph.axis.linear(), y=graph.axis.linear())
+
+ g.plot([graph.data.file(f, x=1, y=2)])
+ g.writeEPSfile(f+'.eps')
+
+g('stridetune.dat')