Skip to content

Conversation

@goshanraj-g
Copy link

Fixes #829
Supersedes #896

Instead of calling rb_ary_new_capa and rb_ary_push for each element (N+1 C function calls), this uses gen_push_opnds and calls rb_ec_ary_new_from_values once (with a leaf call), which matches what the interpreter and YJIT do.

@goshanraj-g goshanraj-g closed this Dec 3, 2025
@goshanraj-g goshanraj-g deleted the optimize-new-array branch December 3, 2025 18:02
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.

ZJIT: Write elements to an array at once on Insn::NewArray

1 participant