Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combining deferred reference counting and tagged pointers #678

Open
markshannon opened this issue May 8, 2024 · 0 comments
Open

Combining deferred reference counting and tagged pointers #678

markshannon opened this issue May 8, 2024 · 0 comments

Comments

@markshannon
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant