FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-103092: isolate _lsprof by aisk · Pull Request #115130 · python/cpython · GitHub

/ cpython Public

gh-103092: isolate _lsprof - #115130

Closed
aisk wants to merge 5 commits into
python:mainfrom
aisk:isolate-lsprof
Closed

gh-103092: isolate _lsprof#115130
aisk wants to merge 5 commits into
python:mainfrom
aisk:isolate-lsprof

Conversation

aisk commented Feb 7, 2024
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

The main change is moving the static variables random_value and random_stream in rotatingtree.c to a struct and storing it in the module's state.

Other changes are to pass the struct from the module's state.

Copy link
Copy Markdown
Contributor

Thanks; can you split out the Argument Clinic adaption and contribute that as a separate PR?

aisk commented Feb 10, 2024
edited
Loading

Copy link
Copy Markdown
Member Author

Sure, see #115242 .

aisk marked this pull request as draft February 10, 2024 12:17

aisk commented Feb 11, 2024

Copy link
Copy Markdown
Member Author

Hi @erlend-aasland, I have a new thought. This change is just to isolate these two static variables:

static unsigned int random_value = 1;
static unsigned int random_stream = 0;

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.

Copy link
Copy Markdown
Contributor

Sounds reasonable. Go ahead!

Copy link
Copy Markdown
Contributor

Superseded by #115301

aisk deleted the isolate-lsprof branch March 1, 2024 05:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL