]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-148072: Cache pickle.dumps/loads per interpreter in XIData (GH-148125)
authorJunya Fukuda <junya.fukuda.e@gmail.com>
Mon, 6 Apr 2026 15:37:02 +0000 (00:37 +0900)
committerGitHub <noreply@github.com>
Mon, 6 Apr 2026 15:37:02 +0000 (11:37 -0400)
commit3d724dd9149068ec9c335262d81d410a564d3598
tree0dfc1850e3267afcfb3fbf4d8c4fe92f45ab66de
parentf8293faf37971fd0d4d30c0c83df2ac654e610a1
gh-148072: Cache pickle.dumps/loads per interpreter in XIData (GH-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.
Include/internal/pycore_crossinterp.h
Misc/NEWS.d/next/Core_and_Builtins/2026-04-05-00-00-00.gh-issue-148072.xid9Pe.rst [new file with mode: 0644]
Python/crossinterp.c