Replies: 2 comments 2 replies
-
Another question, why not using WASM everywhere, since browser & node.js both supports it |
Beta Was this translation helpful? Give feedback.
-
When running in the browser, the main difference is that WASM files need to be hosted and fetched, before initializing. Where asm.js can be bundled together with the lib. And then of course WASM should be faster. When running on the Node.js server, native should be faster. However there are Node.js environments where native modules are not supported (e.g. StackBlitz's WebContainers), or other JS runtimes that support WASM (e.g. Vercel's Edge Runtime, CloudFlare's worker, or Deno). Of course there are other difference between asm.js, native and WASM, such as security and compatibility. Overall there are many trade-offs between each choice, and it's better to pick the one that works the best for your use case. |
Beta Was this translation helpful? Give feedback.
-
In the Runtime and WASM section of the README, I learned that in browser, satori uses asm.js by default, but can optionally use WASM too.
So what's the difference between these two usages?
Does the WASM method perform better?
What's the tradeoff to consider when choosing between these methods?
And does the WASM way work in Node.js? If so, what's the comparison between native module vs WASM?
Beta Was this translation helpful? Give feedback.
All reactions