-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use internal self._headers
var in FileResponse
#10107
Conversation
The prepare path called self.headers which has to do a property lookup each time. As we are already inside the object we can use self._headers instead
_headers
property in FileResponse
self._headers
var in FileResponse
CodSpeed Performance ReportMerging #10107 will not alter performanceComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #10107 +/- ##
=======================================
Coverage 98.75% 98.75%
=======================================
Files 122 122
Lines 36927 36927
Branches 4409 4409
=======================================
Hits 36469 36469
Misses 311 311
Partials 147 147
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Backport to 3.11: 💚 backport PR created✅ Backport PR branch: Backported as #10108 🤖 @patchback |
(cherry picked from commit 84bb77d)
Backport to 3.12: 💚 backport PR created✅ Backport PR branch: Backported as #10109 🤖 @patchback |
(cherry picked from commit 84bb77d)
…in `FileResponse` (#10108) Co-authored-by: J. Nick Koston <[email protected]>
…in `FileResponse` (#10109) Co-authored-by: J. Nick Koston <[email protected]>
The
prepare
path called the publicself.headers
property which has to do a property lookup each time. As we are alreadyinside the object we can use
self._headers
instead. This change alignsweb_fileresponse
withweb_response
which usesself._headers
and notself.headers
. This change will not make a significant difference in performance but will make the profile a bit easier to read.