Better performance for text rendering using CodeMirror component