bpo-23403: [lib2to3] Make grammar pickling faster by ambv · Pull Request #6491 · python/cpython
-
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.
* 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.
ambv
changed the title
[lib2to3] Make grammar pickling faster
bpo-23403: [lib2to3] Make grammar pickling faster
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
The grammar pickle is a cache.
Yeah, and that cache is over twice as small with protocol 4 :)
I wish we'd generate it at CPython build time rather than ever do the runtime load and save a cache thing.
Yeah, that would make my life easier ;)
@ambv: Please replace # with GH- in the commit message next time. Thanks!
ambv
deleted the
fastgrammarpickle
branch