mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 18:04:49 -04:00
Use slots in attrs classes where possible (#8296)
slots use less memory (and attribute access is faster) while slightly limiting the flexibility of the class attributes. This focuses on objects which are instantiated "often" and for short periods of time.
This commit is contained in:
parent
d2a3eb04a4
commit
aec294ee0d
22 changed files with 33 additions and 50 deletions
|
@ -383,7 +383,7 @@ class CachesStream(Stream):
|
|||
the cache on the workers
|
||||
"""
|
||||
|
||||
@attr.s
|
||||
@attr.s(slots=True)
|
||||
class CachesStreamRow:
|
||||
"""Stream to inform workers they should invalidate their cache.
|
||||
|
||||
|
@ -441,7 +441,7 @@ class DeviceListsStream(Stream):
|
|||
told about a device update.
|
||||
"""
|
||||
|
||||
@attr.s
|
||||
@attr.s(slots=True)
|
||||
class DeviceListsStreamRow:
|
||||
entity = attr.ib(type=str)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue