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

Add benchmark to stress specialization by doing different specialization on different threads. #1

Open
markshannon opened this issue Nov 7, 2023 · 0 comments

Comments

@markshannon
Copy link
Member

Take this fib function:

def fib (n, one):
    if  n <= 1:
        return one
    return fib(n-1, one) + fib(n-2, one)

Call fib(20, 1) on one thread, and fib(20, 1.0) on another.
Maybe use something other than fibonacci, but you get the idea.

With a GIL the specialization will flip-flop, but will be mostly correctly specialized as since the tier 1 interpreter is adaptive.
This will be a challenge for NoGIL, however.
In theory the tier 2 optimizer should work with NoGIL, but this should tell us if it doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant