-
-
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
Restore 304 performance after fixing FileResponse
replace race
#10113
Conversation
CodSpeed Performance ReportMerging #10113 will improve performances by 17.63%Comparing Summary
Benchmarks breakdown
|
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 #10113 +/- ##
==========================================
+ Coverage 98.33% 98.76% +0.42%
==========================================
Files 122 122
Lines 36951 36961 +10
Branches 4399 4410 +11
==========================================
+ Hits 36337 36503 +166
+ Misses 439 311 -128
+ Partials 175 147 -28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
FileResponse
replace race
Backport to 3.11: 💚 backport PR created✅ Backport PR branch: Backported as #10117 🤖 @patchback |
) (cherry picked from commit 0130213)
Backport to 3.12: 💚 backport PR created✅ Backport PR branch: Backported as #10118 🤖 @patchback |
) (cherry picked from commit 0130213)
…ing `FileResponse` replace race (#10118)
…ing `FileResponse` replace race (#10117)
Nice! I might have guessed maybe 5% penalty from the buffered open. How big is the benchmark file (at least 4K I hope)? |
The test uses this 11.1KB file https://github.com/aio-libs/aiohttp/blob/master/tests/sample.txt The size of the file shouldn't make much (or maybe any) difference with most file systems unless its doing some type of read-ahead in the background since for most file systems, reading the metadata about the file doesn't require reading the contents. |
Followup to #10101 to address the feedback in #10112
We can avoid opening the file is we are going to send a 304.
fixes #10112