On Tue, Feb 10, 2004, Tim Peters wrote: > [Tim] >> ... >> Guido explained it: we can add one 4-byte field to the list object >> header on a 32-bit box for free now, but adding two grows every list >> object by 8 bytes. > > To be more precise, we can add one 4-byte field for free on 32-bit > boxes under compilers where "long double" has 4-byte alignment. We > can't add anything for free under compilers where "long double" has > 8-byte alignment; this includes Microsoft's compiler, alas. (The gc > header is forced to long double alignment via a union trick, and that > makes the gc header consume 16 bytes (4 of them unused padding) under > MSVC.) So in other words, we might as well go ahead and trade space for speed? If someone really does have a million small lists, they're probably mutating some of them constantly (or they'd use tuples). -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "The joy of coding Python should be in seeing short, concise, readable classes that express a lot of action in a small amount of clear code -- not in reams of trivial code that bores the reader to death." --GvR
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4