4 ms·
More importantly, even small integers are heap-allocated. Some are pre-allocated and reused (0 to 100, IIRC), but outside of that, every numeric result require
by KMag 6y ago
More importantly, even small integers are heap-allocated. Some are pre-allocated and reused (0 to 100, IIRC), but outside of that, every numeric result requires a malloc and object initialization.
- BerislavLopac 6y ago-5 to 256
- akx 6y agoNot exactly. Small objects are allocated using an internal arena allocator called pymalloc: https://docs.python.org/3/c-api/memory.html#the-pymalloc-allocator https://docs.python.org/3/c-api/memory.html#the-pymalloc-all...