diff options
author | Raymond Hettinger <python@rcn.com> | 2013-07-28 02:39:49 -0700 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2013-07-28 02:39:49 -0700 |
commit | 77578204d6aeb89a9ee8365f8fb28ce18aa2eb7c (patch) | |
tree | 303daae3dfcb80a883facdae7d593e3e099779c3 /Lib/test/test_deque.py | |
parent | 1f1d0a57fad17fb0fb1e1a44b1a38be17ea9976e (diff) | |
download | cpython-git-77578204d6aeb89a9ee8365f8fb28ce18aa2eb7c.tar.gz |
Restore the data block size to 62.
The former block size traded away good fit within cache lines in
order to gain faster division in deque_item(). However, compilers
are getting smarter and can now replace the slow division operation
with a fast integer multiply and right shift. Accordingly, it makes
sense to go back to a size that lets blocks neatly fill entire
cache-lines.
GCC-4.8 and CLANG 4.0 both compute "x // 62" with something
roughly equivalent to "x * 9520900167075897609 >> 69".
Diffstat (limited to 'Lib/test/test_deque.py')
-rw-r--r-- | Lib/test/test_deque.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py index ae1de9ab46..7bff1d2798 100644 --- a/Lib/test/test_deque.py +++ b/Lib/test/test_deque.py @@ -536,7 +536,7 @@ class TestBasic(unittest.TestCase): @support.cpython_only def test_sizeof(self): - BLOCKLEN = 64 + BLOCKLEN = 62 basesize = support.calcobjsize('2P4nlP') blocksize = struct.calcsize('2P%dP' % BLOCKLEN) self.assertEqual(object.__sizeof__(deque()), basesize) |