> Memory usage > -------------------- > > on amd64 arch. > > key-sharing dict: > > * 96 bytes for ~3 items > * 128 bytes for 4~5 items. Note: There are another shared key. * 128 bytes for ~3 items * 224 bytes for 4~5 items So, let S = how many instances shares the key, * 90 + (96 / S) bytes for ~3 items * 128 + (224 / S) bytes for 4~5 items > > compact dict: > > * 224 bytes for ~5 items. > > (232 bytes when keep supporting key-shared dict) > > interned key only dict: > > * 184 bytes for ~5 items > > > Note > ------ > > Interned key only dict is still larger than key-shared dict. > > But it can be used for more purpose. It can be used for interning string > for example. It can be used to kwargs dict when all keys are interned already. > > If we provide _PyDict_NewForNamespace to extension modules, > json decoder can have option to use this, too. > > > -- > INADA Naoki <songofacandy at gmail.com> -- INADA Naoki <songofacandy at gmail.com>
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