-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Refactor requests and responses to use classvar defaults to avoid multiple __init__
s
#10037
Conversation
The downside is we have to drop `__slots__` but the trade-off might be worth it.
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 #10037 +/- ##
==========================================
- Coverage 98.73% 98.73% -0.01%
==========================================
Files 121 121
Lines 36771 36750 -21
Branches 4392 4391 -1
==========================================
- Hits 36307 36286 -21
Misses 314 314
Partials 150 150
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #10037 will improve performances by 95.13%Comparing Summary
Benchmarks breakdown
|
Wasn't expecting that kind of improvement. I would say the trade off is worth it especially considering we can do it in a few more places |
__init__
__init__
s
I'm neutral to this change. |
Wow! 2.5% is a high number, I didn't expect this. |
Part of the issue with benchmarks that run coros (not a problem for non coros) is that we have to use aiohttp/tests/test_benchmarks_client.py Line 33 in 006fbc3
|
__init__
s__init__
s
__init__
s__init__
s
Backport to 3.11: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 2e369db on top of patchback/backports/3.11/2e369db2d9abcbef41031592b4f044adf5f89f59/pr-10037 Backporting merged PR #10037 into master
🤖 @patchback |
Backport to 3.12: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 2e369db on top of patchback/backports/3.12/2e369db2d9abcbef41031592b4f044adf5f89f59/pr-10037 Backporting merged PR #10037 into master
🤖 @patchback |
… use classvar defaults to avoid multiple `__init__`s (#10053)
… use classvar defaults to avoid multiple `__init__`s (#10054)
I was looking at the benchmarks and was wondering why 3.x was faster creating many objects. This PR re-aligns
master
to be similar to how these are implemented in 3.x as it was before #3942Refactor mixins to avoid having to call
__init__
by using classvar defaults instead.The downside is we have to drop
__slots__
but the trade-off seems worth it based on the benchmark.