Add doc for compresslevel of the GZipMiddleware and use compresslevel=5 in the example#11412
Closed
RaphaelMarinier wants to merge 2 commits intofastapi:masterfrom
Closed
Add doc for compresslevel of the GZipMiddleware and use compresslevel=5 in the example#11412RaphaelMarinier wants to merge 2 commits intofastapi:masterfrom
compresslevel of the GZipMiddleware and use compresslevel=5 in the example#11412RaphaelMarinier wants to merge 2 commits intofastapi:masterfrom
Conversation
compresslevel=5 is typically a better tradeoff than 9, e.g. see: https://tukaani.org/lzma/benchmarks.html
Member
|
📝 Docs preview for commit 1ba7288 at: https://12056547.fastapitiangolo.pages.dev |
Contributor
|
Seems like it's duplicated PR #11350 |
Author
|
Indeed, it's mostly a duplicate (I was not aware of it), except that the default I propose in the doc is probably a better tradeoff (typically 3x less CPU usage, for only one percent point larger outputs). |
Member
|
Thanks @RaphaelMarinier! 🚀 I just merged #11350, but I added I'll close this one now. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
compresslevelis defined there in starlette's GZipMiddleware:https://github.com/encode/starlette/blob/4e453ce91940cc7c995e6c728e3fdf341c039056/starlette/middleware/gzip.py#L30
compresslevel=5 is typically a better CPU / compression level tradeoff than 9, e.g. see:
https://tukaani.org/lzma/benchmarks.html