Repository navigation
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.
gh-148706: Pure-Python pickle._Pickler can be significantly optimized #148707
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
Uh oh!
There was an error while loading. Please reload this page.
gh-148706: Pure-Python pickle._Pickler can be significantly optimized #148707
Changes from 1 commit
94b53ebbb9d72169eed04285fcae7c6af842f1d38be917108024a57c4f0b43cFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Add `bytes` to the save() dispatch fast path, placed AFTER the four non-memoized atomics (int / None / bool / float) so int-heavy workloads don't pay an extra type-identity branch before hitting their direct dispatch. bytes is memoized, so memo.get is inlined alongside the save_bytes call the same way str is. Dump deltas on a bytes-heavy workload: list_of_short_bytes_5k dump -10.7% list_of_medium_bytes_1k dump -11.7% dict_bytes_to_int_2k dump -9.1% list_of_bytearrays_1k dump +0.4% (bytearray isn't caught; hits dispatch table) Main-bench impact (F2 -> F6v2), within ±0.7% across all benches. bytearray specialisation is a separate question; rare in real payloads. test_pickle 1060/1060. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing