Cache uuid conversions (#524)

This commit is contained in:
J. Nick Koston 2023-08-16 00:10:11 -05:00 committed by GitHub
parent eebc7d99f2
commit 81dad013d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -849,7 +849,12 @@ class UserService(APIModelBase):
def _join_split_uuid(value: list[int]) -> str: def _join_split_uuid(value: list[int]) -> str:
"""Convert a high/low uuid into a single string.""" """Convert a high/low uuid into a single string."""
return str(UUID(int=(value[0] << 64) | value[1])) return _join_split_uuid_high_low(value[0], value[1])
@lru_cache(maxsize=256)
def _join_split_uuid_high_low(high: int, low: int) -> str:
return str(UUID(int=(high << 64) | low))
def _uuid_converter(uuid: str) -> str: def _uuid_converter(uuid: str) -> str: