__slots__ in HA core

Hi all,

I was thinking that due to the size and scale of HA that using slots might be useful for memory/performance.

There’s an autoslot package in pypi that could be used for this purpose.

I was wondering if there was any interest in adding this, so I could decide whether to work on a PR?

If so, given the size of the codebase, it would be a pretty big undertaking. So perhaps only certain elements of core could be modified? And if so, which?


Ugh, I wish I had known there was a memory profiler built into HA. I spent many hours trying to figure out how to get other profilers to work.

I’ve been looking at the results, but am hesitant to keep going. I really don’t feel like doing all this work, submitting a PR and have it languish as an open one forever.

Is there any interest in me continuing this?