3 ms·
How efficiently does Java run when compiled to the browser platform? (e.g. WASM) (The browser is an important target these days, so imho this question must be
by amelius 8y ago
How efficiently does Java run when compiled to the browser platform? (e.g. WASM)
(The browser is an important target these days, so imho this question must be addressed; besides, I want to be able to use the same code on the server as on the client; and sadly, the JVM isn't guaranteed to work in every browser).
- bloomthrowaway 8y agoI'm really excited for WASM, it should be nearly as fast as native code. Java and native code aren't far apart though, so I would say 1.5-2x faster generally
- amelius 8y agoOk, but I'm worried about the garbage collector, and if it can run concurrently without interrupting the program (as a native JVM would do it).
- bloomthrowaway 8y agoIt should be able to... Hopefully Go and Java will be some of the first GC languages to target WASM, and we'll find out :) . Personally I'm more worried about the size of the GC getting added to the binaries than how fast it is.
- pjmlp 8y agoAssemblyScript already does it, if I am not mistaken.
- jackpeterfletch 8y agoIf the Javascript garbage collecter can do it then I don't see why not.
- amelius 8y agoThe JS GC can run in native code, in a separate native thread with shared memory access, and it can use things like memory barrier instructions, which have no equivalent in WASM yet.