[issue40521] Make tuple, dict, frame free lists, unicode interned strings, unicode latin1 singletons per-interpreter

STINNER Victor report at bugs.python.org
Tue May 5 11:48:02 EDT 2020


New submission from STINNER Victor <vstinner at python.org>:

tuple, dict and frame use free lists to optimize the creation of objects.

Unicode uses "interned" strings to reduce the Python memory footprint and speedup dictionary lookups.

Unicode also uses singletons for single letter Latin1 characters ([U+0000; U+00FF] range).

All these optimizations are incompatible with isolated subinterpreters, since caches are currently shared by all inteprepreters. These caches should be made per-intepreter. See bpo-40512 "Meta issue: per-interpreter GIL" for the rationale.

I already made small integer singletons per interpreter in bpo-38858:

* commit 5dcc06f6e0d7b5d6589085692b86c63e35e2325e
* commit 630c8df5cf126594f8c1c4579c1888ca80a29d59.

----------
components: Interpreter Core
messages: 368175
nosy: vstinner
priority: normal
severity: normal
status: open
title: Make tuple, dict, frame free lists, unicode interned strings, unicode latin1 singletons per-interpreter
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40521>
_______________________________________


More information about the Python-bugs-list mailing list