-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-136681: make argsbuf static to speedup processing positional arguments with AC #136732
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
579822c
to
c88f2bf
Compare
arguments with AC
c88f2bf
to
5463883
Compare
benchmark: #136681 (comment) |
Won't this break when called concurrently? |
Yes, apparently it does :-( Probably, this can't be fixed easily. Alternative approach should work: #136681 (comment). The |
Hmm, @ZeroIntensity, test seems fixed with using combined |
Hm, you could try it and see what the test suite says. To my knowledge, thread local lookups are generally slower, so we might not see a speedup. |
Well, CI tests pass, but that might be just an accident.
Here my quick measurements for default configure arguments on Linux box. (Free-threading build might change the picture.) Micro-benchmarks are for math.fmin(): when only positional arguments are allowed (as in the main) vs positional-or-keyword allowed. In the main:
With the patch:
Benchmark hidden because not significant (1): fmin(1.0, 2.0) x 2 times import pyperf
from math import fmin
def f(n):
for _ in range(n):
fmin(1.0, 2.0)
runner = pyperf.Runner()
runner.bench_func('fmin(1.0, 2.0)', fmin, 1.0, 2.0)
for n in [2, 10, 100]:
s = f'fmin(1.0, 2.0) x {n:3} times'
runner.bench_func(s, f, n) |
Uh oh!
There was an error while loading. Please reload this page.