[PATCH 0 of 3 RFC] performance: use ctx.size comparisons to speed up status

Nicolas Dumazet nicdumz at gmail.com
Sat Jul 24 21:12:52 CDT 2010


Hello!

Those changes are brought here as part of my investigation of issue2273.

== Short version ==

Test script:
"""
hg init test1
hg init test2

cd test1; dd if=/dev/zero of=test seek=1024k bs=100 count=1; hg ci -Am test
dd if=/dev/zero of=test seek=1024k bs=200 count=1
cd ../test2; hg pull ../test1; hg up; echo foo > test2; hg ci -Am test2
cd ../test1; hg pull ../test2; hg up; time hg stat
"""

Before:
    1.34user 0.30system 0:01.70elapsed
After:
    0.68user 0.08system 0:00.79elapsed

Better, but remember that this used to take 100ms on 1.5.3 ... ;)


== Longer ==

First patch does not really matter to me. It was necessary to help
me understand the flow of status. We can definitely drop it if someone dislikes
it: this serie is not about such nitpicks.


The hardest part was to figure out a way to check if ctx.size() checks were
meaningful for this repo. Keyword extension changes data size, and I'd expect
the other extensions dealing with Encodings to do the same. And even without
any extensions, it seems that encode/decode filters would bork size() results
as well.
Hence the localrepo._cancomparesize . Naming is not too fancy, if anyone comes
with something clearer, I'd happily change it.

Rest of the changes should be straightforward.

Thanks for the review!
-Nicolas.


More information about the Mercurial-devel mailing list