Created
March 3, 2023 11:30
-
-
Save nekufa/fbc238d0561d31dbf8224b90b96df449 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Response: | |
data: list | |
async def get_data(): | |
# we have 250k rows of lists with 7 tuples - str and int | |
return [] | |
async def handler_empty(): | |
await get_data(); # 2 sec | |
return {'data': []} # 0 sec | |
async def handler_render_json(): | |
return {'data': await get_data()} # 5 sec | |
async def handler_render_response(): | |
return Response(data=await get_data()) # 8sec | |
async def handler_render_response_with_typed_result() -> Response: | |
return Response(data=await get_data()) # 12sec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment