# HG changeset patch # User Boris Feld # Date 1542926924 -3600 # Node ID 0adc2c0a0792d4a0015ec0634487ed9e08fd0e7e # Parent 0a3cc351d7189969b98c7f926b408837683f003b perf: run 'setup' function during stub run The benchmarked function might need the content of the setup to be run in order to function properly. diff -r 0a3cc351d718 -r 0adc2c0a0792 contrib/perf.py --- a/contrib/perf.py Fri Nov 23 02:08:01 2018 +0100 +++ b/contrib/perf.py Thu Nov 22 23:48:44 2018 +0100 @@ -276,6 +276,8 @@ return functools.partial(_timer, fm, displayall=displayall), fm def stub_timer(fm, func, setup=None, title=None): + if setup is not None: + setup() func() @contextlib.contextmanager