Skip to content

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

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

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

Conversation

@kumaraditya303

@kumaraditya303kumaraditya303 commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

@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

Benchmarkbench_basebench_turbo
tuple_concat_unpack92.5 us92.9 us: 1.00x slower
str_repeat99.2 us97.8 us: 1.01x faster
bytes_concat102 us103 us: 1.01x slower
bytes_repeat89.0 us87.0 us: 1.02x faster
tuple_repeat85.2 us83.8 us: 1.02x faster
chained_list_ops143 us140 us: 1.02x faster
mixed_float_int49.6 us50.8 us: 1.02x slower
float_mix_mul50.9 us51.4 us: 1.01x slower
Geometric mean(ref)1.00x faster

Not significant: list_concat_subscr, dict_merge.

Run 2

Benchmarkbench_base2bench_turbo2
list_concat_subscr95.5 us94.7 us: 1.01x faster
tuple_concat_unpack92.5 us93.0 us: 1.01x slower
str_repeat99.0 us98.1 us: 1.01x faster
bytes_concat102 us103 us: 1.01x slower
bytes_repeat89.3 us87.2 us: 1.02x faster
tuple_repeat85.3 us83.7 us: 1.02x faster
dict_merge181 us182 us: 1.01x slower
chained_list_ops142 us140 us: 1.02x faster
mixed_float_int49.6 us50.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.

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsBot added the stale Stale PR or inactive for long period of time. label May 18, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

staleStale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@kumaraditya303@Fidget-Spinner@eendebakpt