Message259885
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 |
|
Date |
User |
Action |
Args |
2016-02-08 20:42:46 | gregory.p.smith | set | recipients:
+ gregory.p.smith, nnorwitz |
2016-02-08 20:42:46 | gregory.p.smith | set | messageid: <1454964166.73.0.652183434251.issue26314@psf.upfronthosting.co.za> |
2016-02-08 20:42:46 | gregory.p.smith | link | issue26314 messages |
2016-02-08 20:42:46 | gregory.p.smith | create | |
|