Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hello J2CL team,

Thank you very much for the work you do and especially for WASM support. As I can see, currently JRE WASM emulation (arrays for instance) highly relies on javascript arrays via imports. So the resulting wasm can be executed only in browsers. It would be great, if one day it ll be possible to run it on the server side.

Do you have any plans about WASI?

PS:
I did a few tests (yeah, with j2cl-maven-plugin) to check how fast a WASM app runs comparing to the same javascript app. So I took my yaml databinder for j2cl and adopted it to work with WASM (well, I replaced JS regex with Google’s re4j). Serialization and deserialization in chrome (gc + string_ref) works at pretty much the same speed as the javascript application. Maybe because gc isn’t great atm or maybe regex is slow (well, I expected it will be faster :) ). It’s hard to say right now. But it looks very promising.

You must be logged in to vote

We don't rely on JavaScript arrays but we rely on stuff like String, Regex, Math. It is a subset of what you see here plus more String stuff which is hidden behind some not-yet-standardized APIs.

Currently we are highly focused on browser use cases; maybe that can change in the future but not very soon.

re. performance:

For some data point, J2CL Wasm mode is roughly 2x faster than the JS mode for heavy computation but not for everything.

JS regex is blazingly fast; much faster than re2j for average input. To put into perspective, our benchmarks shows J2CL/JS regex is 35x faster on the same input compared to re2j running on JVM. Re2j is good for guaranteed lower bounds but not for general …

Replies: 1 comment

Comment options

We don't rely on JavaScript arrays but we rely on stuff like String, Regex, Math. It is a subset of what you see here plus more String stuff which is hidden behind some not-yet-standardized APIs.

Currently we are highly focused on browser use cases; maybe that can change in the future but not very soon.

re. performance:

For some data point, J2CL Wasm mode is roughly 2x faster than the JS mode for heavy computation but not for everything.

JS regex is blazingly fast; much faster than re2j for average input. To put into perspective, our benchmarks shows J2CL/JS regex is 35x faster on the same input compared to re2j running on JVM. Re2j is good for guaranteed lower bounds but not for general performance. Actually Regex is one of the reasons we have pushed for first class String support in Wasm spec (so we can use JS regex from the host environment efficiently).

You must be logged in to vote
0 replies
Answer selected by treblereel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.