-
-
Save mike-huls/75ad4a7840e36a33606192aeabe4a1c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pympler.asizeof import asizeof | |
no_slots = PersonWithoutSlots(first_name='mike', last_name='huls', age=33) | |
with_slots = PersonWithSlots(first_name='mike', last_name='huls', age=33) | |
print('no_slots:', asizeof(without_slots), 'bytes') #488 bytes | |
print('with_slots:', asizeof(with_slots), 'bytes') #208 bytes (-57,4%) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment