Skip to content
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

gh-96019: makeunicodedata decomposition cache bug #96020

Conversation

cfbolz
Copy link
Contributor

@cfbolz cfbolz commented Aug 16, 2022

Fix a small bug in makeunicodedata where the caching of decompositions lists was broken because the code was trying to use list.index with two lists of integers to find pre-existing identical decompositions, which always failed. Use a dict with tuple keys instead.

cfbolz added 2 commits August 16, 2022 09:31
…ions

saves a small amount of space (~4.5KB) in the unicodedata module
Copy link
Member

@isidentical isidentical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing find @cfbolz! Small comment below.

Before:

14397 unique decomposition entries: 28792 bytes
decomp_data: 57588 bytes

After:

12086 unique decomposition entries: 24170 bytes
decomp_data: 48344 bytes

@isidentical isidentical changed the title gh-96019 makeunicodedata decomposition cache bug gh-96019: makeunicodedata decomposition cache bug Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants