[PATCH 3 of 5 RFC] dirstate: make dirstate._join a bit faster on posix

Yuya Nishihara yuya at tcha.org
Sun Aug 13 20:50:52 EDT 2017


On Sat, 12 Aug 2017 01:22:58 -0700, Kostia Balytskyi wrote:
> # HG changeset patch
> # User Kostia Balytskyi <ikostia at fb.com>
> # Date 1502522493 25200
> #      Sat Aug 12 00:21:33 2017 -0700
> # Node ID bac7b1ae4a0c998c57cea5eac51af66853779918
> # Parent  a1c8f310a66ada40697c824f4621bb54c757e9fa
> dirstate: make dirstate._join a bit faster on posix
> 
> This is a micro-optimization, suggested by @quark for one of the previous
> patches. It is safe to land the series without this micro-optimization.
> 
> diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
> --- a/mercurial/dirstate.py
> +++ b/mercurial/dirstate.py
> @@ -99,6 +99,9 @@ class dirstate(object):
>          # for consistent view between _pl() and _read() invocations
>          self._pendingmode = None
>  
> +        if pycompat.osname != 'nt':
> +            self._join = self._join_posix

Assigning a bound method to self creates a reference cycle. nt/posix can be
selected statically.


More information about the Mercurial-devel mailing list