Skip to content

Generate East-oriented forwarders as source for zero-alloc delegation#55

Merged
saturnflyer merged 1 commit into
mainfrom
perf/east-oriented-codegen
Jun 27, 2026
Merged

Generate East-oriented forwarders as source for zero-alloc delegation#55
saturnflyer merged 1 commit into
mainfrom
perf/east-oriented-codegen

Conversation

@saturnflyer

Copy link
Copy Markdown
Owner

Hoist the ivar-vs-method branch to definition time and generate the forwarding method with (...) argument forwarding plus literal receiver lookup and send. Forwarded calls now allocate zero objects and run ~2.8x-5x faster on Ruby 4.0 (Object Shapes / YJIT friendly) versus the previous define_method + send approach. Setter and operator method names fall back to define_method.

Raise required_ruby_version to >= 3.2, pin dev to 4.0.5, add Ruby 4.0 to CI, and cover keyword/operator forwarding with tests.

Hoist the ivar-vs-method branch to definition time and generate the
forwarding method with (...) argument forwarding plus literal receiver
lookup and send. Forwarded calls now allocate zero objects and run
~2.8x-5x faster on Ruby 4.0 (Object Shapes / YJIT friendly) versus the
previous define_method + __send__ approach. Setter and operator method
names fall back to define_method.

Raise required_ruby_version to >= 3.2, pin dev to 4.0.5, add Ruby 4.0 to
CI, and cover keyword/operator forwarding with tests.
@saturnflyer saturnflyer force-pushed the perf/east-oriented-codegen branch from 74c5607 to 2208b17 Compare June 27, 2026 03:09
@saturnflyer saturnflyer merged commit d76c19a into main Jun 27, 2026
3 checks passed
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.

1 participant