-
-
Notifications
You must be signed in to change notification settings - Fork 941
Integrate WASM-based Prism parser into standard build #9184
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
base: 10.1-dev
Are you sure you want to change the base?
Conversation
This integrates jruby-prism 2.0 by shading it into our main JRuby jar and loading it from there. Incoming packages considered to be for internal use are moved under `org.jruby.internal`. The output of parser statistics now shows the actual class of the parser, since either or both can be activated now.
|
Performance of a "gem list" benchmark with legacy parser versus wasm prism (after sufficient warmup): legacy: wasm prism: Wierdly this runs much better with tiered compilation turned off ( |
|
Benchmark command line: Remove |
|
Try this. Its straight out of my Kernel IPC. Transort.rb Combine that for a control message layer for fd-passing. Check to see if exists. If it does, try this. the trouble is the socket send/receive isnt exposed for ancillary data @headius . |
If this is parsed by Prism, it's a ProgramNode contained in a ParseResult, so just use the ParseResult.
|
Also try out something like this. What i did was use message pack binaries as the translator between the 2 natives. The key is the 4-byte length prefix framing pattern. That's what makes the binary protocol work reliably over the socket. Both sides read length first, then exactly that many bytes. |
|
@headius You're on the right track with WASM portability, but the benchmark reveals something interesting. Instead of: You get: This is how my kernel IPC coordinates cross-process operations. The control message layer (SCM_RIGHTS) is the missing piece for passing data efficiently between isolated runtimes. I didn't want you to scratch your head on why I gave you the code i did. |
|
@CufeHaco He does not really care too much about how to do this because it is so artificial is not useful in the real world. He is looking for how well chicory will warm up doing the same task over and over. It is more of a test at how fast Chicory can get with prisms wasm. Your general idea of a persistent parser which uses IPC is a big idea but we have went down the paths of external processes before (albeit differently - drip and the other one). Not the same but a lesson learned was that managing an external service is a pain. It also tended to create more confusion issues because something is transparently happening that people are not expecting. That is not to say it is a bad idea. It really could give amazing parsing performance but if you look at prism native performance the parsing time really is a small percentage of overall execution time. I tend to think a bigger priority for parse would be to get native prism builds onto installations (which could be precompiled with dist, post-install hook, nag warn on install). |
|
@enebo I do apologize thst I dont come across clearly. Dont look at what the thing is, im referring to how its structured. Look at the how. Im using the JEP-380 structure because its what i have showing the cleanest mechanics. Im Sure Prisim has its own bytecode we can build byte arrays with? If so, what im proposing would be just like the builtins, just for bytcode interlop. In the IPC, im just substituting bytecode for message pack binaries for the arrays. |
|
I do also just want to add im still learning java and the JVM. Im still relying on you and Charles to point me in the right direction. Im trying to use established abstraction place holders so I can understand and communicate better. @enebo . For best results, focus me one one thing at you need me to hyper focus on. I learn the stack as I go. |
This continues the integration of Prism parser wrapper libraries from the jruby-prism project by shading it in and including the new WASM support and Chicory libraries.
This is a prototype of how it should eventually look and this PR is intended to iterate.
Notable behavior changes so far:
-Xparser.prismbut the dynamic library is not configured or present, it will fall back on the wasm parser.-Xparser.prism.wasmthe wasm parser will be used.The artifacts this depends on comes from: