You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The initial render on document load is horribly unacceptably slow (saw 1 minute on a math-heavy page).
The unrendered text does show very fast (#15) but it's not very useful since the editor is paralyzed until all math is rendered.
same with markText without replacedWith! invisible markers are nearly free.
everything is at least 2× slower due to logging with an open JS console.
full typesetting takes 62s.
Chrome profiling suggests a lot of time is spent in visibleLines, (via endOperation←updateDisplay←markText).
Indeed text gradually shifts vertically as math is typeset. => Should try keeping view/cursor on top instead of bottom.
Naive attempts to wrap with cm.operation don't help because post-Typeset callbacks come one by one.
tried an incremental approach => 61s. no loss, no gain. Still makes editor barely responsive.
I guess CM's input polling doesn't get much chance to run.
Activity
cben commentedon Oct 23, 2013
Verified that loading MathJax from the network is not the blocker; it's the rendering itself.
cben commentedon Oct 23, 2013
Pasting same text into http://cben.github.io/CodeMirror-MathJax/demo.html typesets much faster (~10s instead of ~60s).
Sounds like using CM of fixed size helps a lot.
Alternatively it could be caused by Firepad?
cben commentedon Oct 29, 2013
Some rough measurements on a heavy doc:
Indeed text gradually shifts vertically as math is typeset. => Should try keeping view/cursor on top instead of bottom.
Naive attempts to wrap with
cm.operationdon't help because post-Typeset callbacks come one by one.I guess CM's input polling doesn't get much chance to run.
cben commentedon Nov 22, 2013
Migrated to mathdown, where it belongs. The mathdown-specific part is #24 and maybe #21.
Fix root cause of #85 in CM-MJ: