vardbapi: optimize pickle load for Python >=3.2
authorZac Medico <zmedico@gentoo.org>
Thu, 2 Aug 2012 20:22:02 +0000 (13:22 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 2 Aug 2012 20:22:02 +0000 (13:22 -0700)
pym/portage/dbapi/vartree.py

index 5008a97fb85f7027801d94e08e1f1bfac126d841..1dadd3cbb29acb3ae52b1ecf25323f3ec663d1b1 100644 (file)
@@ -572,11 +572,12 @@ class vardbapi(dbapi):
        def _aux_cache_init(self):
                aux_cache = None
                open_kwargs = {}
-               if sys.hexversion >= 0x3000000:
+               if sys.hexversion >= 0x3000000 and sys.hexversion < 0x3020000:
                        # Buffered io triggers extreme performance issues in
                        # Unpickler.load() (problem observed with python-3.0.1).
                        # Unfortunately, performance is still poor relative to
-                       # python-2.x, but buffering makes it much worse.
+                       # python-2.x, but buffering makes it much worse (problem
+                       # appears to be solved in Python >=3.2 at least).
                        open_kwargs["buffering"] = 0
                try:
                        f = open(_unicode_encode(self._aux_cache_filename,