A wasm b-tree, skip list, rope, etc seems to outperform the equivalent javascript code by many times.
Edit: I just whipped up a real benchmark to test this, replaying some text editing traces[1].
Replaying the automerge-perf editing trace in javascript naively takes 610ms. Using a javascript based skip list it takes 77ms[2]. In native rust, with a rust port of the same skip list code I can process the same editing trace in 6ms[3]. Or 20ms when that rust code is compiled to wasm.
So in this case, we're seeing about a 4x performance improvement using wasm, or 13x performance improvement using native code.
[1] https://github.com/josephg/crdt-benchmarks
[2] This code https://gist.github.com/josephg/bcb2e74e52dc9c4651249fdffc48... using this library: https://www.npmjs.com/package/jumprope