From: zooko Date: Mon, 1 Oct 2007 02:08:24 +0000 (+0530) Subject: zfec: make benchmark script do 3-of-10 instead of 25-of-100 X-Git-Url: https://git.rkrishnan.org/vdrive/%22file:/frontends/%22doc.html/%22news.html/status?a=commitdiff_plain;h=fb0dc23d023ee39f5233ea2c037509b08341448f;p=tahoe-lafs%2Fzfec.git zfec: make benchmark script do 3-of-10 instead of 25-of-100 darcs-hash:84457ef3d731586591350a17856f5f04ebd44aba --- diff --git a/zfec/bench/bench_zfec.py b/zfec/bench/bench_zfec.py index 7097d20..6f37b21 100644 --- a/zfec/bench/bench_zfec.py +++ b/zfec/bench/bench_zfec.py @@ -12,29 +12,32 @@ def _make_new_rand_file(size): def donothing(results, reslenthing): pass +K=3 +M=10 + import sha -hashers = [ sha.new() for i in range(100) ] +hashers = [ sha.new() for i in range(M) ] def hashem(results, reslenthing): for i, result in enumerate(results): hashers[i].update(result) def _encode_file(N): - filefec.encode_file(open(FNAME, "rb"), donothing, 25, 100) + filefec.encode_file(open(FNAME, "rb"), donothing, K, M) def _encode_file_stringy(N): - filefec.encode_file_stringy(open(FNAME, "rb"), donothing, 25, 100) + filefec.encode_file_stringy(open(FNAME, "rb"), donothing, K, M) def _encode_file_stringy_easyfec(N): - filefec.encode_file_stringy_easyfec(open(FNAME, "rb"), donothing, 25, 100) + filefec.encode_file_stringy_easyfec(open(FNAME, "rb"), donothing, K, M) def _encode_file_not_really(N): - filefec.encode_file_not_really(open(FNAME, "rb"), donothing, 25, 100) + filefec.encode_file_not_really(open(FNAME, "rb"), donothing, K, M) def _encode_file_not_really_and_hash(N): - filefec.encode_file_not_really_and_hash(open(FNAME, "rb"), donothing, 25, 100) + filefec.encode_file_not_really_and_hash(open(FNAME, "rb"), donothing, K, M) def _encode_file_and_hash(N): - filefec.encode_file(open(FNAME, "rb"), hashem, 25, 100) + filefec.encode_file(open(FNAME, "rb"), hashem, K, M) def bench(): # for f in [_encode_file_stringy_easyfec, _encode_file_stringy, _encode_file, _encode_file_not_really,]: