I was able to improve the performance of this function by first adding the following code:
editor.document.clearCustomData();
editor.document.removeAllListeners();
editor.window.getFrame().clearCustomData();
editor.window.getFrame().removeAllListeners();
clickTextElement(); , , , . , , , / , .
CKEditor Config. Google CKEditor, , , 50+. 15.
. ( clickTextElement()) 10-20 , . / - .
- clearCustomData() removeAllListeners(), .