diff options
author | scoder <none@none> | 2007-04-20 10:48:29 +0200 |
---|---|---|
committer | scoder <none@none> | 2007-04-20 10:48:29 +0200 |
commit | 5623ee49dbde719d017dbc41bb08c47260bcf2f2 (patch) | |
tree | 8feda77370447c7eb2b7a232e0d8cbea82df69d3 /benchmark | |
parent | c101297a2fe5fbd5364628b695956f9e60d7b6da (diff) | |
download | python-lxml-5623ee49dbde719d017dbc41bb08c47260bcf2f2.tar.gz |
[svn r2231] take minimum time instead of averaging over repeated runs
--HG--
branch : trunk
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/benchbase.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/benchmark/benchbase.py b/benchmark/benchbase.py index 154a79e4..96857e0b 100644 --- a/benchmark/benchbase.py +++ b/benchmark/benchbase.py @@ -362,13 +362,16 @@ def runBench(suite, method_name, method_call, tree_set, tn, an, serial, children for i in range(3): gc.collect() gc.disable() - t = 0 + t = -1 for i in call_repeat: args = [ build() for build in tree_builders ] t_one_call = current_time() method_call(*args) - t += current_time() - t_one_call - t = 1000.0 * t / len(call_repeat) + t_one_call = 1000.0 * (current_time() - t_one_call) + if t < 0: + t = t_one_call + else: + t = min(t, t_one_call) times.append(t) gc.enable() del args |