From fb0dc23d023ee39f5233ea2c037509b08341448f Mon Sep 17 00:00:00 2001 From: zooko <zooko@zooko.com> Date: Mon, 1 Oct 2007 07:38:24 +0530 Subject: [PATCH] zfec: make benchmark script do 3-of-10 instead of 25-of-100 darcs-hash:84457ef3d731586591350a17856f5f04ebd44aba --- zfec/bench/bench_zfec.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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,]: -- 2.45.2