Replies: 4 comments 3 replies
-
As to your second point I plan on prototyping saving serialized blobs "precompiling" to see how much that changes things. This would mean all core JRuby startup .rb files would then just "test" to make sure the blob is still valid and loading that without the parsing step. It could be extended to any ruby file too. In essence it is what you said but labeled as "precompiling". We already have serialized IR and use it for our AOT compiled classes. I also plan on looking at using serialized data for that instead of our current serialization scheme. Measuring speed of processing serialized blob and parsing itself is probably a deciding metric for the idea. |
Beta Was this translation helpful? Give feedback.
-
Yes, I think this would be best and is also required to support the Ruby API/gem on JRuby AFAIK. As you are mentioning, OTOH it feels dangerous to e.g. install the latest version of YARP and use a potentially older libyarp from JRuby or TruffleRuby (there is a high chance the nodes or their fields or serialization format does not match). Hence I think for gem usages, we should use the libyarp of that gem. And then there is no need to have two runtimes variants of serialization, the gem can just always serialize everything. We should measure performance-wise how does the C extension compares to using YARP.load. Then |
Beta Was this translation helpful? Give feedback.
-
I agree that there is no way we can just use libyarp from the gem for execution. Any changes are very likely to effect the Nodes we consume. Some form of foreign function with a simple call to make serialized blob does seem like what JRuby would need. So @HParker idea of using serialize would make supporting YARP and a gem simpler to support. |
Beta Was this translation helpful? Give feedback.
-
I think this is now "solved" in the sense that it's working and we don't want to change it at this point. |
Beta Was this translation helpful? Give feedback.
-
We could implement the Ruby library by consuming binary output similar to how some runtimes are consuming it. Theoretically this is could be a nice logical separation since now YARP has one API consumed by runtimes and tooling. The downside is that means, unless we allow configuring what data you want from that output we need to provide a syntax tree that is suitable for gems using a parser and runtimes.
Theoretically this could mean that the gem implementation of YARP doesn't need to rely on YARP being present on the system at all as long as something provides it the binary API that YARP provides.
Beta Was this translation helpful? Give feedback.
All reactions