mercurial/util.py
changeset 33799 05264fc9d8d6
parent 33793 bbbbd3c30bfc
child 33818 ed04d7254a91
--- a/mercurial/util.py	Wed Jul 26 23:47:54 2017 -0400
+++ b/mercurial/util.py	Mon Aug 14 22:28:59 2017 -0700
@@ -964,10 +964,9 @@
     into. As a workaround, disable GC while building complex (huge)
     containers.
 
-    This garbage collector issue have been fixed in 2.7.
+    This garbage collector issue have been fixed in 2.7. But it still affect
+    CPython's performance.
     """
-    if sys.version_info >= (2, 7):
-        return func
     def wrapper(*args, **kwargs):
         gcenabled = gc.isenabled()
         gc.disable()
@@ -978,6 +977,10 @@
                 gc.enable()
     return wrapper
 
+if pycompat.ispypy:
+    # PyPy runs slower with gc disabled
+    nogc = lambda x: x
+
 def pathto(root, n1, n2):
     '''return the relative path from one place to another.
     root should use os.sep to separate directories