From d9c77eec3c74c3b22b53911afaf2c167818fbc79 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 2 Aug 2012 13:22:02 -0700 Subject: vardbapi: optimize pickle load for Python >=3.2 --- pym/portage/dbapi/vartree.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pym') diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 5008a97fb..1dadd3cbb 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -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, -- cgit v1.2.3-1-g7c22