News for hackers. Stuff that matters.
Re:Why Google Sheets ported its calculation worker from Java... by mirkodrummer on Thursday June 27, 2024 @09:23AM (#40810219)
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
Re:Why Google Sheets ported its calculation worker from Java... by hansvm on Thursday June 27, 2024 @10:29AM (#40810918)
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).
Re:Why Google Sheets ported its calculation worker from Java... by michaelothomas on Thursday June 27, 2024 @12:26PM (#40812283)
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.
Re:Why Google Sheets ported its calculation worker from Java... by 01HNNWZ0MV43FF on Thursday June 27, 2024 @10:07AM (#40810711)
You can call from wasm back into js, I believe some webgl games do that
Re:Why Google Sheets ported its calculation worker from Java... by danielvaughn on Thursday June 27, 2024 @11:16AM (#40811476)
Yep it's a bi-directional communication layer. You can even have shared memory.
Re:Why Google Sheets ported its calculation worker from Java... by mirkodrummer on Thursday June 27, 2024 @09:26AM (#40810255)
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