From 2daccb0e32c67afe12ac265012b2ff089e05773a Mon Sep 17 00:00:00 2001 From: ipeluffo Date: Tue, 14 Apr 2026 11:20:49 +0100 Subject: [PATCH] Enable `slots` option ``` Samples: 200000 - current=156.8 MB peak=156.8 MB Samples: 100000 - current=78.4 MB peak=78.4 MB Samples: 50000 - current=39.2 MB peak=39.2 MB Samples: 1000 - current=0.8 MB peak=0.8 MB Samples: 500 - current=0.4 MB peak=0.4 MB ``` --- fastapi/dependencies/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/dependencies/models.py b/fastapi/dependencies/models.py index b7dac3f29d..85185e067c 100644 --- a/fastapi/dependencies/models.py +++ b/fastapi/dependencies/models.py @@ -28,7 +28,7 @@ def _impartial(func: Callable[..., Any]) -> Callable[..., Any]: return func -@dataclass +@dataclass(slots=True) class Dependant: path_params: list[ModelField] = field(default_factory=list) query_params: list[ModelField] = field(default_factory=list)