A lot of time is spent in decorationsForLine() when we have long lines. I noticed that we iterate the same line more than once for every edit, but I have not figured out where we could delay or remove iterations (yet ?).
Disabling all highlighting for lines longer than 1024 improves the rendering speed very much, but again it is not so nice to not have highlighting.
I also noticed that this patch is not good enough since if I select all of the long line the line will be highlighted...