-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Expose rb_fiber_raise
and tidy up the internal implementation.
#4649
Conversation
9a12453
to
c33fc69
Compare
@eregon @headius I would like to understand how much of a burden this is on the JVM implementations of Ruby. It's advantageous for us to expose these functions from C because it avoids method lookup which can be expensive on the hot path. However, it's also different to use these functions vs something like
I generally feel a few more methods here allows us to reduce overhead by quite a lot in native extensions. But obviously it's more work for other implementations to pick up these changes and support them. |
For TruffleRuby, if it's OK to implement In general I wish CRuby would do better inline caching for rb_funcall() if that's possible, so there is less need to have many C API functions when If you would like other implementations supporting the C API to support |
@eregon Thanks for informing me those details. I agree better MIC or PIC could be great, even if we had to allocate some local storage for it. Making I will try to introduce C API specs. |
3930ea6
to
7414040
Compare
This |
5dc1a53
to
63bbbc7
Compare
@nobu the goal is to have:
The same as:
As discussed on Slack. |
63bbbc7
to
9d83582
Compare
cc @eregon there is a C extension spec, do we need to copy it to the ruby spec repo? |
spec/ruby is sync'd monthly, nothing extra needed. |
Expose
rb_fiber_raise
so it can be called from C extensions.Rework the internal implementation to avoid all the indirection for
resuming_fiber
andfiber_ptr
usage. This should generate slightly more efficient assembly.