Mercurial > hg-stable
changeset 22779:d9585dda63c3
encoding.lower: use fast ASCII lower
This benefits, among other things, the case collision auditor.
On a Linux system with a large real-world repo where all filenames are ASCII,
hg perfcca:
before: wall 0.260157 comb 0.270000 user 0.230000 sys 0.040000 (best of 38)
after: wall 0.164616 comb 0.160000 user 0.160000 sys 0.000000 (best of 54)
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 03 Oct 2014 18:45:56 -0700 |
parents | 80f2b63dd83a |
children | d8ff1f671aed |
files | mercurial/encoding.py |
diffstat | 1 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/encoding.py Fri Oct 03 18:42:39 2014 -0700 +++ b/mercurial/encoding.py Fri Oct 03 18:45:56 2014 -0700 @@ -270,8 +270,7 @@ def lower(s): "best-effort encoding-aware case-folding of local string s" try: - s.decode('ascii') # throw exception for non-ASCII character - return s.lower() + return asciilower(s) except UnicodeDecodeError: pass try: