<https://twitter.com/bashorov/status/1674042199305...
# webassembly
b
https://twitter.com/bashorov/status/1674042199305011202 Special thanks to @Ilya Goncharov [JB]
▶️ 5
K 16
🚀 24
K 1
.wasm 10
b
Awesome!
r
Doesn't work for me ...
Unhandled JavaScript exception: wasm validation error: at offset 123: bad type
b
Which browser do you use?
b
Didn't work for me on Firefox Android either
Same error
r
Try it on Chrome. @bashor I'm assuming play.kotlinlang.org is enrolled in the WasmGC origin trial?
b
Chrome Android works fine
r
So, totally unscientific crappy benchmark, BUT interesting as a starting point: JVM: 173.841535 ms JS: 98.2 ms JS IR: 63.7 ms WASM: 27.7 ms Why is JVM so slow? Something to do with the way play runs this code on the JVM?
I guess JS, JS IR, and WASM are running on my local beefy box, JVM is running on some resource-constrained VM on the play server.
b
I assume JVM hotspot doesn't have enough time to kick in
r
Yeah, but even putting the computeAck in a loop it gets a bit faster at 155 ms but doesn't improve beyond that. But like I said, crappy benchmark.
b
Would be interesting to see a comparison on the same hardware
Maybe even applying some "serverless" optimisations to jvm too
r
Yeah, with kotlinx-benchmark to set up a more reasonable microbenchmark environment
r
@bashor Firefox on Linux
r
@Robert Jaros Same issue here with Firefox on Linux, despite enabling
wasm_function_references
and
wasm_gc
.
r
The compose demo doesn't work as well (https://zal.im/wasm/creative/)
I'm almost sure it did work in the past ...
I'm using Firefox 114.0.2 at the moment
r
I note the Kotlin docs reference
javascript.options.wasm_function_references
and
javascript.options.wasm_gc
, but those aren't available options (any more?) in about:config. They can be added manually but don't exist by default.
b
Ran kotlinx-benchmark on that ack fun. Here are the results (for comparison only) • wasm: 62.658358974358976ms • linuxX64: 243.702351ms • js: 199.5830523333333ms • jvm: 124.03912462037037ms
JS IR on Nodejs wasm on d8
b
Try it on Chrome. @bashor I’m assuming play.kotlinlang.org is enrolled in the WasmGC origin trial?
@rocketraman Sure 🙂
Didn’t work for me on Firefox Android either
@Big Chungus Try Firefox Nightly, but still you need to turn on flags at about:config, more here kotl.in/wasm_help
@Robert Jaros for Firefox GC proposals is available only in Nightly versions now, and not Origin Trials 😞 so you need to turn on features manually at about:config, more here kotl.in/wasm_help
r
https://kotlinlang.slack.com/archives/CDFP59223/p1687967537288999?thread_ts=1687957776.202199&amp;cid=CDFP59223 These are available on FF nightly, and it does work with these enabled. Shame the stable version doesn't even have these flags, even if disabled by default.
b