[PATCH] performance: disable workaround for an old bug of Python

Jun Wu quark at fb.com
Wed Aug 10 10:54:09 EDT 2016


I guess some mercurial code is depending on this for perf reasons -
disabling it would make things slower for CPython.

Maybe we can just disable it for Pypy.

Excerpts from Maciej Fijalkowski's message of 2016-08-10 16:45:58 +0200:
> # HG changeset patch
> # User Maciej Fijalkowski <fijall at gmail.com>
> # Date 1469708281 -7200
> #      Thu Jul 28 14:18:01 2016 +0200
> # Node ID 300f14ea21432face8d7e6cdcf92ba9d2f1f92dc
> # Parent  2f4cd91aaa9a2ad1e4de097a1ec7a59127d51e20
> performance: disable workaround for an old bug of Python
> 
> Since disabling the gc does things worse for pypy and the bug was
> fixed in 2.7, let's only enable it in <2.7
> 
> diff --git a/mercurial/util.py b/mercurial/util.py
> --- a/mercurial/util.py
> +++ b/mercurial/util.py
> @@ -852,6 +852,8 @@
>  
>      This garbage collector issue have been fixed in 2.7.
>      """
> +    if sys.version >= (2, 7):
> +        return func
>      def wrapper(*args, **kwargs):
>          gcenabled = gc.isenabled()
>          gc.disable()


More information about the Mercurial-devel mailing list