Routing checks handlers in each request #2540
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kludex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The logic in
routing.py
checks whether the handler is async in each request.https://github.com/encode/starlette/blob/554f368809e0d891a699667faf0cfbb20057eeb2/starlette/routing.py#L71
This does not seem to be required and if we do the check only once at the beginning of
request_response
, we achieve some performance gains as seen in https://github.com/encode/starlette/pull/2536/filesBeta Was this translation helpful? Give feedback.
All reactions