patch: more sftp unit tests
Robey Pointer
robey at lag.net
Tue Dec 20 05:04:05 GMT 2005
On 14 Dec 2005, at 18:10, Robert Collins wrote:
> On Mon, 2005-12-12 at 20:33 -0800, Robey Pointer wrote:
>>
>> I think this is the real problem. SSH negotiation is hard, and
>> (currently) for each unit test, we do each side of the negotiation,
>> sync up, do the test, then do a clean sync'd shutdown.
>
> Can we profile this? I think connection sharing during the tests is
> quite ugly for us - and I'd rather have a slightly slow (but not
> hugely!) test suite that is clean. My main concern is that sftp
> *appears* much slower than HTTP, and if that is the case, then its
> concerning independently of the test suite : optimising the test suite
> is a bandaid.
I had some free time this weekend, so I played around with lsprof.
The result of running
$ ./bzr --lsprof selftest test_no_working_tree
(which runs a single sftp unit test in 2.5 seconds on my iBook) is
posted here:
http://www.lag.net/~robey/sftp_test.html
One surprising thing to me was that the branch's put_controlfiles()
accounted for nearly an entire second. I guess the branch
initialization is doing a handful of sync requests as part of each
test's setup. So that's at least one thing I've learned. :)
I wrote a little script to generate HTML files out of lsprof output,
so I can click around in the output and "follow the slow". Since
others may find it useful too, it's attached. To make it work you
also need a small patch to bzr, to make it generate pickled lsprof
files instead of dumping text. Also attached.
robey
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lsprof-patch.txt
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20051219/6b135c48/attachment.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lsprof-html.py
Type: text/x-python-script
Size: 4290 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051219/6b135c48/attachment.bin
More information about the bazaar
mailing list