bpo-44206: Add a version number to dictionary keys#26333
Merged
Conversation
…sion is 0 before modification of a key.
Member
Author
|
Skipping news, as this is strictly internal. |
3cfccd7 to
0088371
Compare
methane
reviewed
May 25, 2021
|
|
||
| CHECK(0 <= mp->ma_used && mp->ma_used <= usable); | ||
| CHECK(IS_POWER_OF_2(keys->dk_size)); | ||
| CHECK(IS_POWER_OF_2(DK_SIZE(keys))); |
Member
Author
|
Performance results |
methane
reviewed
May 27, 2021
| typedef enum { | ||
| DICT_KEYS_GENERAL = 0, | ||
| DICT_KEYS_UNICODE = 1, | ||
| DICT_KEYS_UNICODE_NO_DUMMY = 2, |
Member
There was a problem hiding this comment.
_Py_dict_lookup() don't have specialized case for DICT_KEYS_UNICODE_NO_DUMMY. Can we delete this kind?
This kind is used only here.
Line 1226 in a316f34
But it can be replaced with mp->ma_used > mp->ma_keys->dk_nentries.
methane
approved these changes
May 28, 2021
malor
added a commit
to malor/cpython-lldb
that referenced
this pull request
Nov 17, 2024
python/cpython#26333 changed the way the size of the hash table is stored: instead of storing the actual value, dict now saves a log2 of that, which allowed to change the data type of the corresponding struct field from Py_ssize_t to uint8_t making all dict objects more compact.
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.
Apart from adding a version number, this PR also:
I'll need to run pyperformance before merging, in case this slows things downs.
https://bugs.python.org/issue44206