3 ms·
Where can I read about what kind of performance improvements `__slots__` brings?
by BurningFrog 5y ago
Where can I read about what kind of performance improvements `__slots__` brings?
- WillDaSilva 5y agoThe Python docs themselves is a good place to start: https://docs.python.org/3/reference/datamodel.html#slots https://docs.python.org/3/reference/datamodel.html#slots The Python wiki also has some good info about it: https://wiki.python.org/moin/UsingSlots https://wiki.python.org/moin/UsingSlots
- disconnect3d 5y agoApart from the official docs, this video also explains the low level data layout (in CPython) that slots introduce: https://www.youtube.com/watch?v=Iwf17zsDAnY https://www.youtube.com/watch?v=Iwf17zsDAnY