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

JIT: Use pthread_jit_write_protect_np on macOS #126195

Open
diegorusso opened this issue Oct 30, 2024 · 0 comments
Open

JIT: Use pthread_jit_write_protect_np on macOS #126195

diegorusso opened this issue Oct 30, 2024 · 0 comments
Assignees
Labels
OS-mac performance Performance or resource usage topic-JIT type-feature A feature request or enhancement

Comments

@diegorusso
Copy link
Contributor

diegorusso commented Oct 30, 2024

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

@diegorusso diegorusso added the type-feature A feature request or enhancement label Oct 30, 2024
@diegorusso diegorusso self-assigned this Oct 30, 2024
@diegorusso diegorusso added topic-JIT performance Performance or resource usage labels Oct 30, 2024
@Eclips4 Eclips4 added the OS-mac label Oct 30, 2024
diegorusso added a commit to diegorusso/cpython that referenced this issue Oct 30, 2024
Replace mprotect with pthread_jit_write_protect_np
on MacOS Apple Silicon.
Improve JIT performance by ~1.4% on this platform.
diegorusso added a commit to diegorusso/cpython that referenced this issue Oct 30, 2024
Replace mprotect with pthread_jit_write_protect_np
on MacOS Apple Silicon.
Improve JIT performance by ~1.4% on this platform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-mac performance Performance or resource usage topic-JIT type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants