| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Store references to pickle.dumps and pickle.loads in _PyXI_state_t so they are looked up only once per interpreter lifetime, avoiding repeated PyImport_ImportModuleAttrString calls on every cross-interpreter data transfer via pickle fallback. Benchmarks show 1.7x-3.3x speedup for InterpreterPoolExecutor when transferring mutable types (list, dict) through XIData.
|
🤖 New build scheduled with the buildbot fleet by @ZeroIntensity for commit 1d378e7 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F148125%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks!
Sorry, something went wrong.
…ythonGH-148125) Store references to pickle.dumps and pickle.loads in _PyXI_state_t so they are looked up only once per interpreter lifetime, avoiding repeated PyImport_ImportModuleAttrString calls on every cross-interpreter data transfer via pickle fallback. Benchmarks show 1.7x-3.3x speedup for InterpreterPoolExecutor when transferring mutable types (list, dict) through XIData.
| Back | FazBrowse Home | New Git URL |
Summary
Cache pickle.dumps and pickle.loads references per interpreter in _PyXI_state_t, avoiding repeated PyImport_ImportModuleAttrString calls on every cross-interpreter data transfer via the pickle fallback path.
Currently, _PyPickle_Dumps() and _PyPickle_Loads() call PyImport_ImportModuleAttrString("pickle", "dumps"/"loads") on every invocation. By caching the function references in the per-interpreter XI state (initialized lazily on first use, cleared during interpreter finalization), this overhead is eliminated.
Changes
Benchmark results
Measured with identity(x): return x submitted repeatedly, max_workers=1, Apple M2.
Mutable type transfer (1,000 iterations)
Large payload transfer (500 iterations)
Design notes
Test plan