benchmark selftests

Robert Collins robertc at robertcollins.net
Thu May 18 08:43:31 BST 2006


Martin and I have revamped the benchmarking test suite concept, we pair
programmed a small an fairly elegant tool to let us have benchmarks.

I'm merging it into bzr.dev now (it has two +1's :)).

To use it, just do 'bzr selftest --benchmark -v'. We probably should
make -v default to on.

This will run the benchmarks and report how long they take. Our first
one is for 'add'. In the output there are two numbers:
time-of-benchmarked-operations/total-time-for-test.

This lets you write (for instance) a benchmark that tests the
performance of commit on 10K files without it being conflated with the
performance of add on 10K files.

To make something in a benchmark test accrue time to the benchmarked
operations counter, run it via self.time.

I.e. "self.time(self.run_bzr, 'add')" will run self.run_bzr('add') and
have that timed.

The time is not reentrant safe: if you time a routine that times things,
the time will be added twice. The intent is that the operations being
timed should always be in the benchmark test itself, for clarity of what
is being tested, so this should not be a significant issue.

Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060518/a4893b36/attachment.pgp 


More information about the bazaar mailing list