News for hackers. Stuff that matters.
Re:Faster CRDTs: An Adventure in Optimization by Jweb_Guru on Saturday July 31, 2021 @08:54AM (#28017679)
The wasm implementation here was still running under a JavaScript test harness, so I suspect it's the JS-WASM boundary interactions that are causing the slowdown. WASM itself (if it doesn't need to interact with JavaScript) usually runs with a much smaller performance penalty.
Re:Faster CRDTs: An Adventure in Optimization by josephg on Saturday July 31, 2021 @10:33AM (#28018468)
I suspect so too - given there are 280 000 calls across the JS-wasm boundary, and most of those calls pass a string. I'd love to know for sure though. I considered making this benchmark pass the whole data set in one go through JSON or something, but that felt like cheating - since thats not how the API would be used in practice during a real editing session.

But even paying that cost, it still seems much faster to use rust + WASM than run the same algorithm in native javascript. And the JS-wasm boundary will probably get gradually faster over the next few years.