3 ms·
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 bal
by hansvm 2y ago
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).
- michaelothomas 2y agoThe 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.