The same techniques that native apps use to process large documents should be possible in JS/WASM land, no? Given, you probably won't reach native performance, but it seems to me a snappy text editing experience even for large documents should be perfectly doable using web tech.