LaTeX in post preview is slow

I have been writing (and editing) a number of longer posts¹ with a lot of maths in them lately. Sadly, whenever you change a single character, the whole preview is reset which in particular means that all math has to be retypeset. This is annoying (everything reflows!) and a real bummer on slower machines (think netbooks, tablets, ...); when I edit a longer post I have to wait several seconds (>10s have happened) before I can check wether the syntax was good.

With the techniques shown here it should be possible to let MathJax redo only single paragraphs; that would already be a huge help. In principle, it should be easy to split preview input by paragraphs and only reparse (and mathify) those that changed. Please (have tech) look into this.

¹ Side-by-side and/or selective preview would be cool, too, but that is for another day.

• What browser are you using? I found older (3.x) versions of Firefox to be especially slow at MathJax (worse than IE of similar vintage), and recent versions of Chrome to be the fastest. – Gilles 'SO- stop being evil' Apr 1 '12 at 22:12
• Posting on a child meta is absolutely fine. – Gilles 'SO- stop being evil' Apr 1 '12 at 22:14
• This should probably be tagged as support. – Kaveh Apr 2 '12 at 5:07
• @Gilles: Firefox 10. Atom N270, though. – Raphael Apr 2 '12 at 5:49
• Still in issue with FF 26 and Atom D525. – Raphael Jan 15 '14 at 7:45

Because the math can include things like \def, \label, \ref, etc., it turns out to be a more complex process to do incremental updates than you might think. I did a version of it here, but I don't think it works any more (hooking into the SE editor was fragile, and I think the code has changed since I wrote the userscript, and it no longer is able to hook in properly).
• Yes, typesetting from the definition onwards works (and my code sample does that). Dealing with \label and \ref is more complicated, as references can precede their use. Yes, the lists can be certainly be handled -- I only included it to indicate that breaking into paragraphs is not enough, and that doing this properly takes a more complex approach. – Davide Cervone Jan 20 '14 at 13:19