python / python/cpython

JIT: Use pthread_jit_write_protect_np on macOS

Open
#126,195 1 comment 1 reaction 1 assignee View on GitHub

@diegorusso is already working on this.

Since Oct 30, 2024.

OS-mac performance topic-JIT type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Feature or enhancement

Proposal:

The proposal is an internal implementation of the JIT and it transparent to the user.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

Not on Discourse, I've had extensive discussion about this with @brandtbucher and created a prototype that we benchmarked using the faster-cpython infrastructure. The full results are here: https://github.com/faster-cpython/benchmarking-public/tree/main/results/bm-20241018-3.14.0a1+-f74cd79-JIT

On macOS on Apple Silicon there is an overall 1.4% speed improvement by replacing the mprotect with pthread_jit_write_protect_np.

Linked PRs
  • gh-126196

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.