Skip to content

Combining deferred reference counting and tagged pointers #678

@markshannon

Description

@markshannon

CPython does a lot of reference counting operations that have a major impact on the performance of the JIT and interpreter.

CPython also boxes all integers, which means that integer operations that are extremely cheap in most languages are quite expensive in (C)Python.

We can remove of the cost of reference counting by using deferred reference counting and almost all of the cost of boxing ints by using tagged pointers.

It is worth grouping these two issues together, as changes required to support deferred reference counting and those for tagged ints have some overlap. We need to distinguish between references on the stack, on the heap and passed to the C API for both deferred references and tagged int.
This means that work done for one will help the other.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions