Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-103092: isolate _lsprof#115130
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-103092: isolate _lsprof#115130
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thanks; can you split out the Argument Clinic adaption and contribute that as a separate PR? |
aisk commentedFeb 10, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Sure, see#115242 . |
Hi@erlend-aasland, I have a new thought. This change is just to isolate these two static variables: cpython/Modules/rotatingtree.c Lines 11 to 12 in1a6e213
But as they are the state of a pseudo-random generator, they can be shared between interpreters under a lock. For single interpreter usage, there is no noticeable performance decrease. And this work can be done easily. I have no idea if this approach is acceptable, or whether we should continue with the previous work. If it does, I can do some benchmarking to see if there is a performance decrease in multiple isolated interpreters usage. |
Sounds reasonable. Go ahead! |
Superseded by#115301 |
Uh oh!
There was an error while loading.Please reload this page.
The main change is moving the static variables
random_value
andrandom_stream
inrotatingtree.c
to a struct and storing it in the module's state.Other changes are to pass the struct from the module's state.