-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Response.ContentEncoding(): store as field and avoid using Header.SetCanonical() #1311
Conversation
The CE is not so often used for plain APIs responses and even not so often used for static files and on the fly compression. But still it should be checked each time. Also having a dedicated field getter and setter simplifies code
…ial() methods instead of SetCanonical() The change should improve performance because the setSpecialHeader() call is omitted. As a downside on adding a new basic header field all putHeader() must be replaced with a direct getter and setter.
Thanks! |
Thank you, Eric. You may noticed that for the Request I didn't added the
And some providers supports this e.g. https://docs.openx.com/demand-partners/compression-traffic-gzip/ or https://protocol.bidswitch.com/rtb/data-format.html Even while not so many such http clients but under a heavy load this may have a difference. |
Lets leave it for now until someone complains about it. |
…Canonical() (valyala#1311) * Response.ContentEncoding(): store as field The CE is not so often used for plain APIs responses and even not so often used for static files and on the fly compression. But still it should be checked each time. Also having a dedicated field getter and setter simplifies code * header.go Use shorter Response.setNonSpecial() and Request.setNonSpecial() methods instead of SetCanonical() The change should improve performance because the setSpecialHeader() call is omitted. As a downside on adding a new basic header field all putHeader() must be replaced with a direct getter and setter.
The CE is not so often used for plain APIs responses and even not so often used for static files and on the fly compression.
But still it should be checked each time so instead of peek headers map it will be faster to check a field.
Also having a dedicated field getter and setter simplifies code.