Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 6 min read Release mediumAdept

Meta contributes new features to Python 3.12

Meta upstreamed several features into CPython 3.12, many derived from its Cinder runtime: immortal objects (PEP 683) that skip reference counting to cut copy-on-write memory in forked Instagram workers, the @typing.override decorator (PEP 698), and inlined comprehensions (PEP 709) running up to 2x faster. Other changes include opt-in eager asyncio tasks that resolve immediately-available results without event-loop scheduling, a LOAD_SUPER_ATTR opcode that avoids allocating super objects, and new async_tree and comprehension benchmarks in pyperformance. New runtime hooks, including vectorcall entrypoints, dict/type/function/code watchers, and a thread-safe perf-map API, let third-party JITs like CinderX plug into CPython.

Assumes: Python reference countingasyncio basicsCPython bytecode

Related posts

  • Lazy is the new fast: How Lazy Imports and Cinder accelerate machine learning at Meta

    Meta Engineering easyNovice

    Meta rolled out the Cinder Python runtime with Lazy Imports, which transparently defers all imports until first use, across ML frameworks and Jupyter kernels. The change cut time to first batch (TTFB) by up to 40 percent and Jupyter kernel startup by 20 percent. Unlike importlib's LazyLoader, it needs no hand-picked lazy imports and removes the need for TYPE_CHECKING guards. Libraries such as PyTorch, NumPy, SciPy and Numba broke because they depend on import side effects and ordering, so Meta enables lazy imports only during startup and preparation and turns them off before the first batch.

  • Introducing Immortal Objects for Python

    Meta Engineering mediumAdept

    Instagram's pre-fork Django servers were losing shared memory to copy-on-write because CPython mutates reference counts and GC headers even on effectively read-only objects. PEP-683 Immortal Objects marks a special refcount value so the runtime never modifies an object's refcount or GC header, which keeps those pages shared and lets objects be shared across threads without the GIL. Upstreaming required preserving backward compatibility across platforms, compilers, word sizes and endianness, and careful register allocation held the refcount-path check to about a 2% regression. The change is a building block for PEP-684 (per-interpreter GIL) and PEP-703 (optional GIL).

  • How the Cinder JIT’s function inliner helps us optimize Instagram

    Meta Engineering hardMaster

    Cinder, Instagram's open-source CPython fork, ships a method-at-a-time JIT that lowers bytecode through HIR, SSA, LIR and register allocation to native code, removing interpreter dispatch and stack overhead. Because type information is only available within a single function, generic operations like BinaryOp and VectorCall often can't be specialized. The new function inliner splices known call targets (identified via guarded global loads) into the caller's CFG. It does this by SSA-ifying the callee separately, splitting the block, rewriting LoadArg and Return into Assigns, adding shadow-frame bookkeeping, and cleaning the CFG. Later type inference and optimization passes can then specialize or even constant-fold the inlined code.

  • Pyodide Spin Out and 0.17 Release

    Mozilla Hacks mediumAdept

    Pyodide, CPython 3.8 compiled to WebAssembly for running Python in the browser, has spun out of Mozilla into an independent, community-governed project, and Mozilla is winding down Iodide. The 0.17 release redesigns Python/JavaScript type translation so round trips return identical objects: only primitives convert implicitly, other objects are shared as proxies with explicit to_py/toJs/to_js converters. It also adds an asyncio event loop on the browser event loop with mutual awaiting of Promises and coroutines, and bidirectional exception translation. Migrating to upstream-LLVM Emscripten shrank SciPy from 92 MB to 15 MB and the base environment from 8.1 MB to 6.4 MB, with 25–30% faster runtime.

  • Making Python in Zed Fun

    Zed easyNovice

    Zed reworked its Python support around a generic per-language toolchain selector backed by Microsoft's python-environment-tools, the same library Visual Studio Code uses for venv detection. A manifest tree tracks the nearest pyproject.toml so each monorepo sub-project gets its own toolchain. Zed also runs a separate language server per toolchain rather than making servers juggle multiple environments. Basedpyright is now the default LSP, ty and Ruff work out of the box, Pyrefly is available via an extension, and the team plans to move Astral's ty into core and add notebooks in 2026.

The quest for software engineering knowledge.

Look:
Layout: