[PATCH 2 of 5] revlog: use hashlib.sha1 directly instead of through util

Augie Fackler raf at durin42.com
Fri Jun 10 17:36:57 EDT 2016


> On Jun 10, 2016, at 4:47 PM, Matt Mackall <mpm at selenic.com> wrote:
> 
> On Fri, 2016-06-10 at 00:41 -0400, Augie Fackler wrote:
>> # HG changeset patch
>> # User Augie Fackler <raf at durin42.com>
>> # Date 1465531834 14400
>> #      Fri Jun 10 00:10:34 2016 -0400
>> # Node ID bd2caf6762219aba40edd4dd697fee70de306940
>> # Parent  16f5b31b1228212dc175b5a0baf3601cca48330d
>> revlog: use hashlib.sha1 directly instead of through util
>> 
>> Also remove module-local _sha alias, which was barely used.
> 
> @@ -40,7 +41,6 @@ from . import (
>>  _unpack = struct.unpack
>>  _compress = zlib.compress
>>  _decompress = zlib.decompress
>> -_sha = util.sha1
> 
> These are each a micro-optimization on Python's abysmal lookup path.

Ugh. Does it make a measurable difference on a perf command?

> 
> --
> Mathematics is the supreme nostalgia of our time.
> 
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160610/c45352b5/attachment.sig>


More information about the Mercurial-devel mailing list