[MERGE] reconcile - aka fix - with tests

Andrew Bennetts andrew at canonical.com
Fri Feb 24 00:23:19 GMT 2006


Robert Collins wrote:
[...]
> 
> topo_sort takes 4 seconds of wall time to sort the bzr graph.
> the one in reconcile I haven't got an accurate time yet, I don't know
> the python trick offhand to time a method - but its fast enough I can't
> even count to '1 mississipi' before that phase completes.

The trick is the timeit module.

At the command line:

    python -m timeit -s "setup" -s "more setup" "statement to time"

e.g.:

    python -m timeit -s "from bzrlib.weavefile import read_weave" "read_weave(open('.bzr/inventory.weave'))"

You can also import timeit and use it in code directly, but I find that's a bit
awkward.

http://docs.python.org/lib/module-timeit.html

-Andrew.





More information about the bazaar mailing list