python / python/cpython

Cross-interpreter support for efficient sharing of frozendicts

Open
#148,234 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

extension-modules topic-subinterpreters type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Feature or enhancement

Proposal:

The concurrent.interpreters module for subinterpreters handles sharing/sending values across interpreters with direct sharing of some basic immutable types, and a fallback to pickling others. As an immutable container, tuples are supported (as long as all items are themselves shareable). Similarly, I think it would be good to support sharing frozendict without serialization (if keys & values are shareable).

Because dictionaries are so fundamental and common, having a better and more performant way to share such a mapping would significantly improve the experience of using concurrent.interpreters and InterpreterPoolExecutor.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the concurrent.interpreters documentation on sharing objects and the module's existing handling of shareable tuples and mappings. Determine how frozendict sharing could work when all keys and values are shareable; done means supported values cross interpreters without pickling and the behavior is covered by relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.