Skip to content
Snippets Groups Projects
Commit d9585dda63c3 authored by Siddharth Agarwal's avatar Siddharth Agarwal
Browse files

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)
parent 80f2b63dd83a
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment