unitbench 0.1 released!
After writing cppbench, a C++ benchmark framework, I felt inspired to take the next step. I wanted a benchmark library that was similar to unittest in python. I started working on unitbench. I ended up with a library that allows you to start a benchmark with ‘bench’ and it will be run and timed. It has functions that can be overloaded to denote the number of warmup runs to perform and the input to the benchmarks. See the documentation below for full examples and all functions.
Features:
- BSD License
- Supports python 2.6 – 3.2
- Output formatters
- Cross platform
- Fully tested
unitbench pypi page (with downloads)
I’d love to hear any feedback. All comments are appreciated. If you notice any bugs or weird behavior post a bug report to bitbucket or leave a comment here. I’ll try to address it as soon as possible. The same goes for feature requests.
In: Announcement, Python · Tagged with: benchmarks, unitbench

on March 10, 2011 at 5:50 am
· Permalink
Thanks, it’s really awesome!! :D
on July 30, 2011 at 7:37 am
· Permalink
Why not to use timeit module?
on July 30, 2011 at 12:14 pm
· Permalink
This has a number of advantages over timeit. Unitbench can output CSV for easy import into spreadsheet programs. It can report user and system time in addition to wall clock time. Unitbench calculates more statistics for you. While none of the default reporters output them, the minimum, maximum, standard deviation, and variance are all calculated in addition to the average runtime. There is only so much space in the console. Perhaps another form of output should be added. Also setting up the Benchmark class, you can simply add ‘bench_’ functions to run additional benchmarks.
That said, I’ve been working on a new release of unitbench. It will have decorators which can be added to any function. I may add another reporter that outputs all available data, as that does seem like it’s missing.