Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/
Date: Thu, 02 Aug 2012 20:22:23
Message-Id: 1343938922.d9c77eec3c74c3b22b53911afaf2c167818fbc79.zmedico@gentoo
1 commit: d9c77eec3c74c3b22b53911afaf2c167818fbc79
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 2 20:22:02 2012 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 2 20:22:02 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d9c77eec
7
8 vardbapi: optimize pickle load for Python >=3.2
9
10 ---
11 pym/portage/dbapi/vartree.py | 5 +++--
12 1 files changed, 3 insertions(+), 2 deletions(-)
13
14 diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
15 index 5008a97..1dadd3c 100644
16 --- a/pym/portage/dbapi/vartree.py
17 +++ b/pym/portage/dbapi/vartree.py
18 @@ -572,11 +572,12 @@ class vardbapi(dbapi):
19 def _aux_cache_init(self):
20 aux_cache = None
21 open_kwargs = {}
22 - if sys.hexversion >= 0x3000000:
23 + if sys.hexversion >= 0x3000000 and sys.hexversion < 0x3020000:
24 # Buffered io triggers extreme performance issues in
25 # Unpickler.load() (problem observed with python-3.0.1).
26 # Unfortunately, performance is still poor relative to
27 - # python-2.x, but buffering makes it much worse.
28 + # python-2.x, but buffering makes it much worse (problem
29 + # appears to be solved in Python >=3.2 at least).
30 open_kwargs["buffering"] = 0
31 try:
32 f = open(_unicode_encode(self._aux_cache_filename,