diff options
author | Raymond Hettinger <python@rcn.com> | 2013-07-16 08:59:30 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2013-07-16 08:59:30 (GMT) |
commit | 90180c1c3f260ee3085eb3a41aca478b41ac90a8 (patch) | |
tree | dabe551efcbd7b6ca0b84a2e1203c06f760d36ca /Modules | |
parent | b7a285f5287fea77d1af477e83f46c8a44f910f3 (diff) | |
download | cpython-90180c1c3f260ee3085eb3a41aca478b41ac90a8.zip cpython-90180c1c3f260ee3085eb3a41aca478b41ac90a8.tar.gz cpython-90180c1c3f260ee3085eb3a41aca478b41ac90a8.tar.bz2 |
Move the leftlink to the end of the block structure.
The current pattern of memory access will update both the leftlink and
rightlink at the same time, so they should be positioned side-by-side
for better cache locality.
Keeping the leftlink at the front of the structure would make sense
only if the paired updates were eliminated by backporting changesets
49a9c734304d, 3555cc0ca35b, ae9ee46bd471, and 744dd749e25b. However,
that isn't likely to happen, so we're better off with the leftlink at
the end of the structure.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_collectionsmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index f175fca..b0fa23d 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -47,9 +47,9 @@ */ typedef struct BLOCK { - struct BLOCK *leftlink; PyObject *data[BLOCKLEN]; struct BLOCK *rightlink; + struct BLOCK *leftlink; } block; #define MAXFREEBLOCKS 10 |