Why is hg identify so slow?

Frank Kingswood frank at kingswood-consulting.co.uk
Wed Jun 25 07:04:30 CDT 2008


Patrick Mézard wrote:
> Frank Kingswood a écrit :
>> Hallo!
>>
>> I've noticed several times in the past that hg identify is quite slow 
>> compared to hg status. It would seem to me that hg identify actually has 
>> slightly less to do - no need to print out modified or unknown files.
> 
> Actually it does append a small "+" if you have local changes.

No, it doesn't work like status:
$ hg id
abcf05896578 tip
$ touch new-file
$ hg id
abcf05896578 tip
$ hg st
? new-file

So it does not need read the entire working directory, just the files it 
already knows about.

> Can you measure again, comparing "--rev tip" and no arguments ?

$ /usr/bin/time hg identify -r tip
abcf05896578 tip
0.48user 0.06system 0:00.98elapsed 54%CPU
0inputs+0outputs (0major+5224minor)pagefaults 0swaps
$ /usr/bin/time hg identify -r tip
abcf05896578 tip
0.48user 0.03system 0:00.57elapsed 89%CPU
0inputs+0outputs (0major+5224minor)pagefaults 0swaps

$ /usr/bin/time hg identify
0.61user 0.10system 0:18.30elapsed 3%CPU
0inputs+0outputs (1major+7035minor)pagefaults 0swaps
$ /usr/bin/time hg identify
abcf05896578 tip
0.68user 0.16system 0:04.25elapsed 19%CPU
0inputs+0outputs (0major+7036minor)pagefaults 0swaps
$ /usr/bin/time hg identify
abcf05896578 tip
0.67user 0.13system 0:04.38elapsed 18%CPU
0inputs+0outputs (0major+7036minor)pagefaults 0swaps

Frank


More information about the Mercurial-devel mailing list