bpo-23403: [lib2to3] Make grammar pickling faster#6491
Merged
ambv merged 1 commit intopython:masterfrom Apr 17, 2018
Merged
Conversation
* Now uses pickle protocol 4 * Doesn't wrap the grammar's `__dict__` in ordered dictionaries anymore as dictionaries in Python 3.6+ are ordered by default This still produces deterministic pickles (that hash the same with MD5). Tested with different PYTHONHASHSEED values.
gpshead
approved these changes
Apr 16, 2018
Member
gpshead
left a comment
There was a problem hiding this comment.
This seems like a very good idea. The grammar pickle is a cache.
I wish we'd generate it at CPython build time rather than ever do the runtime load and save a cache thing. But that's a separate feature request.
Contributor
Author
Yeah, and that cache is over twice as small with protocol 4 :)
Yeah, that would make my life easier ;) |
|
@ambv: Please replace |
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.
Now uses pickle protocol 4
Doesn't wrap the grammar's
__dict__in ordered dictionaries anymore asdictionaries in Python 3.6+ are ordered by default
This still produces deterministic pickles (that hash the same with MD5).
Tested with different PYTHONHASHSEED values.
https://bugs.python.org/issue23403