Skip to content

gh-131798: JIT inline function pointer address for extended binary op#148384

Draft
kumaraditya303 wants to merge 2 commits intopython:mainfrom
kumaraditya303:jit-inline-binary
Draft

gh-131798: JIT inline function pointer address for extended binary op#148384
kumaraditya303 wants to merge 2 commits intopython:mainfrom
kumaraditya303:jit-inline-binary

Conversation

@kumaraditya303
Copy link
Copy Markdown
Contributor

@kumaraditya303 kumaraditya303 commented Apr 11, 2026

@Fidget-Spinner
Copy link
Copy Markdown
Member

Do you know this is worth it? In this case it's only one dependent load, and something that always resolves the same. So I'm not too sure. We try not to add new uops into the optimizer if they're not worth it as it's more maintenance burden sometimes.

@eendebakpt
Copy link
Copy Markdown
Contributor

I benchmarked the optimization in this PR on top of #128956

Run 1

Benchmark bench_base bench_turbo
tuple_concat_unpack 92.5 us 92.9 us: 1.00x slower
str_repeat 99.2 us 97.8 us: 1.01x faster
bytes_concat 102 us 103 us: 1.01x slower
bytes_repeat 89.0 us 87.0 us: 1.02x faster
tuple_repeat 85.2 us 83.8 us: 1.02x faster
chained_list_ops 143 us 140 us: 1.02x faster
mixed_float_int 49.6 us 50.8 us: 1.02x slower
float_mix_mul 50.9 us 51.4 us: 1.01x slower
Geometric mean (ref) 1.00x faster

Not significant: list_concat_subscr, dict_merge.

Run 2

Benchmark bench_base2 bench_turbo2
list_concat_subscr 95.5 us 94.7 us: 1.01x faster
tuple_concat_unpack 92.5 us 93.0 us: 1.01x slower
str_repeat 99.0 us 98.1 us: 1.01x faster
bytes_concat 102 us 103 us: 1.01x slower
bytes_repeat 89.3 us 87.2 us: 1.02x faster
tuple_repeat 85.3 us 83.7 us: 1.02x faster
dict_merge 181 us 182 us: 1.01x slower
chained_list_ops 142 us 140 us: 1.02x faster
mixed_float_int 49.6 us 50.8 us: 1.02x slower
Geometric mean (ref) 1.00x faster

Numbers are close to (or in) the noise. Maybe 1% faster for this kind of ops.

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

Successfully merging this pull request may close these issues.

3 participants