-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
Improve performance of building URLs with authority #1163
Conversation
Use the fast _split_netloc method so we do not have to reparse the netloc for every property
Verified new tests pass on master as well so we have bug for bug compat with the faster version |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1163 +/- ##
==========================================
+ Coverage 95.54% 95.56% +0.01%
==========================================
Files 30 30
Lines 4892 4911 +19
Branches 446 446
==========================================
+ Hits 4674 4693 +19
Misses 192 192
Partials 26 26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I'm going to do a new release of yarl before we publish a new aiohttp with aio-libs/aiohttp#9309 (comment) fixed |
What do these changes do?
Use the fast
_split_netloc
method so we do not have to reparse the netloc for every property.Previously we called each
SplitResult
property which meant each property call has to reparse thenetloc
every time. Only do it onceAre there changes in behavior for the user?
no
Related issue number
aio-libs/aiohttp#9309 (comment) will call
URL.build
withauthority
much more often in a performance sensitive path.