-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-129068: Make range iterators thread-safe #142886
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
base: main
Are you sure you want to change the base?
Conversation
Now that we specialize range iteration in the interpreter for the common case where the iterator has only one reference, there's not a significant performance cost to making the iteration thread-safe.
|
https://github.com/facebookexperimental/free-threading-benchmarking/tree/main/results/bm-20251216-3.15.0a3+-afd3eff-CLANG,NOGIL shows 1.001x faster, which I think is just noise. I also ran https://github.com/colesbury/fastbench/ locally:
FWIW, I used Codex to convert rangeobject.c to Argument Clinic and it worked pretty well. |
kumaraditya303
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Now that we specialize range iteration in the interpreter, there's not a significant performance cost to making the iteration thread-safe.