Merged
Conversation
By our cautious use of list_versions() and other public API's, safely ignore any ``unicode_version`` argument or ``UNICODE_VERSION`` environment variable. No such things are ever processed. maybe this improves performance of the very first call. One small regret, that we cannot just delete the keyword argument from the signature and stop documenting about it while also ignoring any use, which could reduce its overhead in lru_cache, but I couldn't find a solution that wouldn't also raise TypeError or have some other performance impact.
Merging this PR will improve performance by 25.73%
Performance Changes
Comparing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #195 +/- ##
==========================================
+ Coverage 98.36% 98.53% +0.16%
==========================================
Files 14 14
Lines 919 889 -30
Branches 234 225 -9
==========================================
- Hits 904 876 -28
- Misses 6 7 +1
+ Partials 9 6 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
lru_cache, it seems, is very peculiar about its positional arguments, so we define a single-positioned cache in (default) case of ambiguous_width=1, and otherwise we must also use the positional case of (c, 'auto', ambiguous_width).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #190.
By our cautious use of list_versions() and other public API's, safely ignore any
unicode_versionargument orUNICODE_VERSIONenvironment variable. No such things are ever processed. maybe this improves performance of the very first call.A 20-30% performance boost is found by careful study of an lru_cache performance issue, by careful construction of positional only arguments, of fewest possible positions in the common case (ambiguous_width=1, and unicode_version='auto'). This "performance boost" would have worked with multiple versions, too, a nice discovery.