# HG changeset patch # User Siddharth Agarwal # Date 2014-10-04 01:47:28 # Node ID 70624fda193d022ed85a88c26177137c1d807a8b # Parent d8ff1f671aeda6b568636895f94e4cf0988190b6 normcase: for darwin, use fast ASCII lower Constructing the foldmap is much faster on OS X now. For a large real-world repo, hg perfdirstatefoldmap: before: wall 0.805278 comb 0.800000 user 0.790000 sys 0.010000 (best of 13) after: wall 0.399708 comb 0.410000 user 0.390000 sys 0.020000 (best of 25) This is a nice boost to 'hg status', especially with the third-party hgwatchman extension enabled (which eliminates stat calls). For the above repo, 'hg status' goes from 1.17 seconds to 0.74. diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -217,8 +217,7 @@ if sys.platform == 'darwin': ''' try: - path.decode('ascii') # throw exception for non-ASCII character - return path.lower() + return encoding.asciilower(path) # exception for non-ASCII except UnicodeDecodeError: pass try: