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

Use mimalloc on all Python 3.13 builds #391

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

zanieb
Copy link
Collaborator

@zanieb zanieb commented Nov 11, 2024

Previously, it was only used for the freethreaded builds

Closes #389

Previously, it was only used for the freethreaded builds
@colesbury
Copy link

The --with-mimalloc option is the default, so I think 3.13 it's already built with it. The configure option just adds build time support. You need to set the environment variable PYTHONMALLOC=mimalloc to use mimalloc in the default build. (The free threading build requires and always uses mimalloc.)

I ran PYTHONMALLOC=mimalloc uv run -p 3.13 python -c "while True: x = object()" locally and I see mimalloc functions being executed in perf top.

@zanieb
Copy link
Collaborator Author

zanieb commented Nov 13, 2024

Thanks for the info! It's the default if it's available, which it should be for most of our builds but it might be nice to make it explicit so it fails if it's not available for some reason. Notably the musl builds don't have a sufficient LLVM version for mimalloc and fail here — this is a known issue, ref #326 (comment).

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

Successfully merging this pull request may close these issues.

Build Python 3.13 non free threaded using mimalloc
2 participants