From f52f6ab9cc1ea47f28ec1a820185feba4e3d7c3b Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Thu, 12 Jul 2012 10:11:48 -0300 Subject: don't try to benchmark ciphers or hashes on small inputs The machines finish those tasks faster than we can reliably measure how long it takes them also stop using print_bench_footer, since we're moving toward being able to do benchmarks independently of pyutil. --- src/pycryptopp/bench/bench_ciphers.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/pycryptopp/bench/bench_ciphers.py b/src/pycryptopp/bench/bench_ciphers.py index c8ee6b9..bb9a160 100644 --- a/src/pycryptopp/bench/bench_ciphers.py +++ b/src/pycryptopp/bench/bench_ciphers.py @@ -1,6 +1,6 @@ from pycryptopp.cipher import aes, xsalsa20 -from common import insecurerandstr, rep_bench, print_bench_footer +from common import insecurerandstr, rep_bench UNITS_PER_SECOND = 10**9 @@ -29,16 +29,13 @@ def bench_ciphers(MAXTIME): ob = BenchCrypt(klass, keysize) print ob for (legend, size) in [ - ("small (%d B)", 1000), - ("medium (%d B)", 10000), - ("large (%d B)", 100000), + ("large (%d B)", 10**7), ]: print legend % size rep_bench(ob.crypt, size, UNITS_PER_SECOND=UNITS_PER_SECOND, MAXTIME=MAXTIME, MAXREPS=100, initfunc=ob.crypt_init) print print "nanoseconds per byte crypted" - print_bench_footer(UNITS_PER_SECOND=UNITS_PER_SECOND) print def bench(MAXTIME=10.0): -- cgit v1.2.3