adriangb / xpresso

A composable Python ASGI web framework
https://xpresso-api.dev/
MIT License
178 stars 4 forks source link

feat/perf: give developers the ability to control concurrency in reading multipart requests #16

Closed adriangb closed 2 years ago

adriangb commented 2 years ago

Often multipart requests will have multiple file fields. If developers request those as bytes, or if ExtractField is used to extract those fields into JSON or something else, then it could be a nice performance win to spin up an anyio TaskGroup to read the bytes concurrently. But we probably don't want to just do that for every request, there is a performance penalty to spinning up an anyio TaskGroup (although if it is minimal compared to even reading 2 100 byte files or something, then it's probably worth just making the default and not exposing to users)

adriangb commented 2 years ago

Closing until someone actually asks for this