Mercurial > hg
comparison mercurial/dirstate.py @ 27593:bc97b9af4e62
dirstate: call the C implementation of nonnonormalentries when available
Before this patch, we were using python code for computing the nonnormal
dirstate entries. This patch makes us use the C implementation of the function
when it is available.
Using the nonnormal set in hgwatchman improves hg status performance. Below
are the numbers for mozilla-central.
with the changes:
$ hg perfstatus
! wall 0.010632 comb 0.000000 user 0.000000 sys 0.000000 (best of 246)
without the changes:
$ hg perfstatus
! wall 0.036442 comb 0.030000 user 0.030000 sys 0.000000 (best of 100)
On mozilla-central the improvement to hg status is ~20% (0.25s to 0.2s),
on our big repos at Facebook, the win is ~40% (1.2s to 0.72s).
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Wed, 23 Dec 2015 13:16:03 -0800 |
parents | f2d0ada00257 |
children | 0921caca7703 |
comparison
equal
deleted
inserted
replaced
27592:7c9eb2927879 | 27593:bc97b9af4e62 |
---|---|
49 os.close(tmpfd) | 49 os.close(tmpfd) |
50 vfs.unlink(tmpname) | 50 vfs.unlink(tmpname) |
51 | 51 |
52 def nonnormalentries(dmap): | 52 def nonnormalentries(dmap): |
53 '''Compute the nonnormal dirstate entries from the dmap''' | 53 '''Compute the nonnormal dirstate entries from the dmap''' |
54 return set(fname for fname, e in dmap.iteritems() | 54 try: |
55 if e[0] != 'n' or e[3] == -1) | 55 return parsers.nonnormalentries(dmap) |
56 except AttributeError: | |
57 return set(fname for fname, e in dmap.iteritems() | |
58 if e[0] != 'n' or e[3] == -1) | |
56 | 59 |
57 def _trypending(root, vfs, filename): | 60 def _trypending(root, vfs, filename): |
58 '''Open file to be read according to HG_PENDING environment variable | 61 '''Open file to be read according to HG_PENDING environment variable |
59 | 62 |
60 This opens '.pending' of specified 'filename' only when HG_PENDING | 63 This opens '.pending' of specified 'filename' only when HG_PENDING |