3 import bisect, random, os, re
5 from pyutil import fileutil
7 assert not os.path.exists("benchresults")
9 os.mkdir("benchresults")
16 R=re.compile("ave rate: ([1-9][0-9]*)")
19 fileutil.rm_dir("build")
20 fileutil.rm_dir("instdir")
21 fileutil.remove_if_possible(os.path.join("zfec", "_fec.so"))
22 fileutil.make_dirs("instdir")
23 fname = os.path.join("benchresults", "comp_0-stride_%d"%stride)
24 os.system("PYTHONPATH=instdir ./setup.py develop --install-dir=instdir --stride=%d >/dev/null" % stride)
25 os.system("PYTHONPATH=instdir python -OO ./bench/bench_zfec.py >> %s" % fname)
26 inf = open(fname, "rU")
30 result = int(m.group(1))
31 if results.has_key(stride):
32 print "stride: %d, results: %d (dup %d)" % (stride, result, results[stride])
34 print "stride: %d, results: %d" % (stride, result)
35 results[stride] = result
42 stride = random.randrange(MIN, MAX+1)