Ways to write performance testing for Mercurial (hg) extension using Python
Asked Answered
D

1

5

i wrote an extension for Mercurial e.g. hg dosomthing --rev 5 and I was wondering what is the right approach to writing performance test cases to monitor the performance of the extension from when its executed till its end!

Ta:)

Doucette answered 25/11, 2013 at 10:50 Comment(0)
B
7

Mercurial has support for running itself under a Python profiler. Just execute

$ hg --profile dosomething --rev 5

and you'll see the profile output afterwards. See the hgrc man page for a few options you have. If you just want timing data, then use

$ hg --time dosomething --rev 5

instead.

You should also have a look at the perf extension. It runs a command many times (like the timeit module) and reports the best running time. You'll have to extend the extension to run your new command, but it should be simple since all the performance tests follow the same pattern.

Brucebrucellosis answered 25/11, 2013 at 12:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.