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 gregory.p.smith
Recipients gregory.p.smith, nnorwitz
Date 2016-02-08.20:42:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454964166.73.0.652183434251.issue26314@psf.upfronthosting.co.za>
In-reply-to
Content
The implementation of string interning uses a dict [1].  It would consume less memory and be a bit simpler if it used a set.

Identifier strings in a program are interned.  If you have a large program with a lot of code, this makes for a large dictionary.

Experimenting with changing this to use a set on 2.7 found ~22k savings on an interactive interpreter startup.  Measuring it on a huge application showed a few hundred k saved.

[1]: https://hg.python.org/cpython/file/3.5/Objects/unicodeobject.c#l1579
History
Date User Action Args
2016-02-08 20:42:46gregory.p.smithsetrecipients: + gregory.p.smith, nnorwitz
2016-02-08 20:42:46gregory.p.smithsetmessageid: <1454964166.73.0.652183434251.issue26314@psf.upfronthosting.co.za>
2016-02-08 20:42:46gregory.p.smithlinkissue26314 messages
2016-02-08 20:42:46gregory.p.smithcreate