Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

They also mention that “there are cases where browser APIs are backed by optimized native implementations that are difficult to compete with using Wasm … the team saw nearly a 100 times speedup of regular expression operations when switching from re2j to the RegExp browser API in Chrome” if so how they call RegExp from WasmGC or viceversa? 100 times speedup for native web apis is not something you can ignore, that’s the important lesson here, not everything compiled to wasm will result in a speed again


You can call from wasm back into js, I believe some webgl games do that


Yep it's a bi-directional communication layer. You can even have shared memory.


I'd be really curious to see the same benchmark applied to re2j on a native jvm, contrasted with those same optimized chrome internals. 100x is in the right ballpark for just a core algorithmic difference (e.g., worst-case linear instead of exponential but with a big constant factor), VM overhead (excessive boxing, virtual function calls for single-op workloads, ...), or questionable serialization choices masking the benchmarking (getting the data into and out of WASM).


The difference is primarily algorithmic. Java on WasmGC is about 2x slower than Java on the JVM. The remaining 50x is just Chrome's regex impl being awesome.


perhaps we should have more optimized web apis to use? maybe for creating optimized data structures with strong typing? Not just the typed arrays types, but also typed maps




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: