[Python-Dev] dictnotes.txt out of date? (original) (raw)
Mark Shannon mark at hotpy.org
Wed Jun 13 16:22:02 CEST 2012
- Previous message: [Python-Dev] dictnotes.txt out of date?
- Next message: [Python-Dev] dictnotes.txt out of date?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Eli Bendersky wrote:
Hi pydev,
I was looking at the memory allocation strategy of dict, out of curiosity, and noted that Objects/dictnotes.txt is out of date as far as the parameters go. It says about PyDictSTARTSIZE: ---- * PyDictSTARTSIZE. Starting size of dict (unless an instance dict). Currently set to 8. Must be a power of two. New dicts have to zero-out every cell. Increasing improves the sparseness of small dictionaries but costs time to read in the additional cache lines if they are not already in cache. That case is common when keyword arguments are passed. Prior to version 3.3, PyDictMINSIZE was used as the starting size of a new dict. ----- Although it mentions 3.3, I find no reference to PyDictSTARTSIZE in the code anywhere. Also it mentions PyDictMINSIZE, which doesn't exist any more - having been replaced by PyDICTMINZISESPLIT and PyDICTCOMBINED.
That's my fault. I didn't update dictnotes.txt when I changed PyDict_STARTSIZE to PyDict_MINSIZE_COMBINED.
I don't know what else is out of date, just looked at those and they were. Maybe it would make sense to kill dictnotes.txt, folding some of its more important contents in to comments in dictobject.c, since the latter has a higher chance of being maintained along with code changes?
I think that the parts of dictnotes.txt that just duplicate comments in dictobject.c should be removed. However, I think it is worth keeping dictnotes.txt as it has historical information and results of previous experiments.
Cheers, Mark
- Previous message: [Python-Dev] dictnotes.txt out of date?
- Next message: [Python-Dev] dictnotes.txt out of date?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]