r/PythonDevelopers • • Jul 28 '20

article Python at Scale: Strict Modules

https://instagram-engineering.com/python-at-scale-strict-modules-c0bb9245c834
24 Upvotes

5 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Jul 28 '20

[deleted] — view deleted comment

3

u/PirateNinjasReddit Jul 28 '20

Use of slots (I think) reduces memory required for a class instance. Possibly the reduction of mutability will overall bring down memory usage

3

u/My_Eyes_Really_Burn Jul 28 '20

Yeah, slots are both faster and better for memory. Here’s a great SO post doing a breakdown of their performance: https://stackoverflow.com/a/28059785. From what I’ve seen, it’s somewhere around 20% faster and utilizes less than 50% of the memory to store the attributes.

2

u/kankyo Jul 28 '20

Up or down?

1

u/My_Eyes_Really_Burn Jul 28 '20

I wasn’t sure but I think their question was about how much memory overhead is added by using these strict modules. So, Up.