This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Jim.Jewett
Recipients Jim.Jewett, Mark.Shannon, benjamin.peterson, giampaolo.rodola, gregory.p.smith, jcea, jcon, pitrou, pjenvey, rhettinger, terry.reedy, vstinner
Date 2012-02-29.15:15:35
SpamBayes Score 1.94128e-09
Marked as misclassified No
Message-id <1330528537.29.0.642752292673.issue13903@psf.upfronthosting.co.za>
In-reply-to
Content
As of Feb 28, 2012, the PEP mentions an additional optimization of storing the values in an array indexed by (effectively) key insertion order, rather than key position. ("Alternative Implementation")

It states that this would reduce memory usage for the values array by 1/3.  1/3 is a worst-case measurement; average is 1/2.  (At savings of less than 1/3, the keys would resize, to initial savings of 2/3.  And yes, that means in practice, the average savings would be greater than half, because the frequency of dicts of size N decreases with N.)

It states that the keys table would need an additional "values_size" field, but in the absence of dummies, this is just ma_used.

Note that this would also simplify resizing, as the values arrays would not have to be re-ordered, and would not have to be modified at all unless/until that particular instance received a value for a position beyond its current size.
History
Date User Action Args
2012-02-29 15:15:37Jim.Jewettsetrecipients: + Jim.Jewett, rhettinger, terry.reedy, gregory.p.smith, jcea, pitrou, vstinner, giampaolo.rodola, pjenvey, benjamin.peterson, Mark.Shannon, jcon
2012-02-29 15:15:37Jim.Jewettsetmessageid: <1330528537.29.0.642752292673.issue13903@psf.upfronthosting.co.za>
2012-02-29 15:15:36Jim.Jewettlinkissue13903 messages
2012-02-29 15:15:36Jim.Jewettcreate