Need help to improve editor performance

200k words is going to amount to a lot of DOM to keep in a browser tab. Each book within The Lord of the Rings amounts to about 150k words.

I would say you need a way to split your document into chapters/sections, and only deal with each one at a time. This could perhaps be done virtually (ie without the user knowing their “document” is really several documents).

Replacing text across a large swath is going to take time, no two ways about it, so the key is perceived performance.

Sorry this a bit of a terse answer, but the details depend on your app and PM implementation.