diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-09-14 12:50:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-14 12:50:06 -0400 |
commit | aec294ee0d0f2fa4ccef57085d670b8939de3669 (patch) | |
tree | be1bf0f3786c88287ef814b8434ae720058be1f9 /synapse/http | |
parent | Fix typos in comments. (diff) | |
download | synapse-aec294ee0d0f2fa4ccef57085d670b8939de3669.tar.xz |
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.
Diffstat (limited to 'synapse/http')
-rw-r--r-- | synapse/http/federation/well_known_resolver.py | 2 | ||||
-rw-r--r-- | synapse/http/matrixfederationclient.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/synapse/http/federation/well_known_resolver.py b/synapse/http/federation/well_known_resolver.py index e6f067ca29..a306faa267 100644 --- a/synapse/http/federation/well_known_resolver.py +++ b/synapse/http/federation/well_known_resolver.py @@ -311,7 +311,7 @@ def _parse_cache_control(headers: Headers) -> Dict[bytes, Optional[bytes]]: return cache_controls -@attr.s() +@attr.s(slots=True) class _FetchWellKnownFailure(Exception): # True if we didn't get a non-5xx HTTP response, i.e. this may or may not be # a temporary failure. diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index 5eaf3151ce..3c86cbc546 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -76,7 +76,7 @@ MAXINT = sys.maxsize _next_id = 1 -@attr.s(frozen=True) +@attr.s(slots=True, frozen=True) class MatrixFederationRequest: method = attr.ib() """HTTP method |