Tips for improving codemirror performance


#1

Hello,

First of all, thank you for codemirror. Second, I have a question about how to increment performance for very large texts (more thank 50k lines).

I want to disable all superficial features, and only leave the ones that really matter for my use case.
The normal use-case is pasting a big json string and perform some operations on it.
What I want:

  1. JSON highlight
  2. Line numbers

And that’s all what I want. Every other feature that may slow down the editor should be removed.
Many thanks in advance.


#2

CodeMirror doesn’t really support turning features off – rather, it requires you to turn them on to use them. As long as you don’t set viewportMargin to something big, you should pretty much be getting the full performance you can hope for.


#3

Thank you @marijn
ViewPort is set to 10 above and below by default, right? I find that amount reasonable