mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
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".
This commit is contained in:
parent
1f1d0a57fa
commit
77578204d6
2 changed files with 7 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue