benchmarker: Implement setupEach for per-iteration setup
authorKunal Mehta <legoktm@member.fsf.org>
Mon, 20 Aug 2018 07:21:49 +0000 (00:21 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Mon, 20 Aug 2018 07:22:08 +0000 (00:22 -0700)
commitdc9b750b16abe528ee2ae807b56bcff6108fceef
treea8a2089fa6afbdaca29be90128de975776cb7c32
parentf5f625a4da35abcb4f578462efa8e9552eb2045d
benchmarker: Implement setupEach for per-iteration setup

To bypass caches in legacy code where injection doesn't easily work,
support a per-iteration setup function, 'setupEach', which runs right
before the actual function is timed and called.

And use it in benchmarkTitleValue, where I mistakenly assumed that
'setup' did what I wanted.

Bug: T201992
Change-Id: I2d01d899bf63576df2833705667f1a16604ab4cc
maintenance/benchmarks/Benchmarker.php
maintenance/benchmarks/benchmarkTitleValue.php