I am curious how Javy is implemented and the performance compared with rust wasm.
yes javy is just rust wasm + rquickjs + wizer, I don't know of any direct comparisons of performance when comparing a pure rust implementation with a js implementation with javy, and that would also highly depend on the code you are benchmarking
@Hoping White Whenever anyone asks about QuickJS performance (or the performance of JS interpreters in general), I point them to https://bellard.org/quickjs/bench.html. It doesn't address your question specifically, and none of the results listed there use Wasm as the target, but it will give you a general idea of what to expect.
Specifically, I would expect numbers in the V8 (JIT)
column to be comparable to Rust-on-Wasm. So, for CPU-bound workloads, you could expect a roughly 50x performance difference between QuickJS and Rust -- sometimes more, sometimes less. It varies a lot, though, so you'll want to do your own benchmarking with your specific workload(s) if you need a precise answer.
Porffor is an experimental AoT JS compiler that's targeting the order of AoT/JIT perf. Still very nascent and not production ready but a cool idea: https://porffor.dev/
There is also AOT compilation using SpiderMonkey that I've developed over the past 1.5 years -- available in StarlingMonkey now but please treat as experimental; going to make some blog posts about it soon too
(porffor is a really admirable project; they're at just under 40% language compat; JS-AOT / weval on SpiderMonkey passes the whole language test suite, with the tradeoff that its results are a bit slower than a from-scratch AOT compiler could achieve)
I am using wasmtime on android and wasmi on ios as a script engine in Unity game development. I am trying to find some way to execute JavaScript as webassembly. Then I found Javy, but if Javy is simulated using quickjs, I don't think it can be used in production. Porffor is interesting, I will keep an eye on it now. Thanks for all the replys
StarlingMonkey is definitely going to be used in production.
The performance difference for Javy vs Rust vs alternative approaches for running JavaScript on Wasm are going to depend on your workload and I would encourage you to take benchmarks with your workloads. FWIW, we use Javy in production.
StarlingMonkey is definitely going to be used in production.
Is already, in fact!
in more than one professional corporation servicing many customers and users
:-P
Jeff Charles said:
The performance difference for Javy vs Rust vs alternative approaches for running JavaScript on Wasm are going to depend on your workload and I would encourage you to take benchmarks with your workloads. FWIW, we use Javy in production.
THIS MANY TIMES THIS. These are both great tools and you should choose the one you want. My comment is meant only as a way of answering the "I don't think it can be used in production" question. Jeff is also correct: Javy is used in production now in several places as well. StarlingMonkey also is and will be.
We've been using both Javy and StarlingMonkey with great success. Performance has not been an issue in practice except in very specific cases.
And thanks to component composition, you can always use both JS and Rust if desired, potentially favoring the latter for number crunching.
nice touch, that, Joel
Last updated: Nov 22 2024 at 16:03 UTC