mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-15 14:08:50 -05: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
|
|
@ -35,7 +35,7 @@ if TYPE_CHECKING:
|
|||
from synapse.handlers.e2e_keys import SignatureListItem
|
||||
|
||||
|
||||
@attr.s
|
||||
@attr.s(slots=True)
|
||||
class DeviceKeyLookupResult:
|
||||
"""The type returned by get_e2e_device_keys_and_signatures"""
|
||||
|
||||
|
|
|
|||
|
|
@ -969,7 +969,7 @@ def _action_has_highlight(actions):
|
|||
return False
|
||||
|
||||
|
||||
@attr.s
|
||||
@attr.s(slots=True)
|
||||
class _EventPushSummary:
|
||||
"""Summary of pending event push actions for a given user in a given room.
|
||||
Used in _rotate_notifs_before_txn to manipulate results from event_push_actions.
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from synapse.types import JsonDict
|
|||
from synapse.util import json_encoder, stringutils
|
||||
|
||||
|
||||
@attr.s
|
||||
@attr.s(slots=True)
|
||||
class UIAuthSessionData:
|
||||
session_id = attr.ib(type=str)
|
||||
# The dictionary from the client root level, not the 'auth' key.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue