Skip to content

Add __slots__ to library objects #1109

@JosXa

Description

@JosXa

We have many classes in the library. Bots use a lot of memory.
Let's add __slots__ to the classes where they make sense.

More info on what __slots__ are: https://stackoverflow.com/questions/472000/usage-of-slots?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

We have to consider where it actually makes sense:

  • Let's find out candidates where users are likely to monkey patch their own attributes on library objects. These should not receive slots as it would break existing code bases.
  • Which objects are so big that we would like to benefit from __slot__ 's performance boosts nonetheless?

Please list candidates in the comments.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions