-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
Move lru cache from inside of _encode_host
to outside
#1348
Conversation
Everything ended up being cached on the inside of the function so it makes more sense to have a single cache for hosts
Will need some docs changes as well to deprecate the old cache keys |
Will need to adjust coveragerc for the less lines |
CodSpeed Performance ReportMerging #1348 will improve performances by 40.24%Comparing Summary
Benchmarks breakdown
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1348 +/- ##
==========================================
+ Coverage 96.13% 96.14% +0.01%
==========================================
Files 27 27
Lines 5539 5557 +18
Branches 357 358 +1
==========================================
+ Hits 5325 5343 +18
Misses 188 188
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. |
_encode_host
to outside
Maybe safer to keep the idna encode cache as is in case the user has a lot of idna hosts |
There was a refactoring error in #1348 that set this to the decode size Fix the bug and add coverage to ensure it does not break again. This change never made it to a release
Everything ended up being cached on the inside of
encode_host
so it makes more sense to have a single cache for encoding hosts.The
ip_address
, andhost_validate
caches are now deprecated in favor of a singleencode_host
cache.For backwards compatibility
cache_configure
still accepts the old parameters but will use them to adjust theencode_host
cache size instead. Additionallycache_info
still returns the keys for the old options but will use theencode_host
values.