-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First pass performance #14
Comments
…tor.renderAllMath() to render existing content. hookMath() is cheap. renderAllMath() is still slow and freezes the editor (#14). So is pasting lots of text with math.
fb6b5e0 implements queuing and batching post-Typest markText()s into a cm.operation. Keep track of when to flush the queue was easier than I thought - I just
Which begs the question of how fast can MJ typeset all this math at all in a static doc? |
|
On a math-heavy 100K doc, speeds up "All math rendered" from 38s to 18s! #68, cben/CodeMirror-MathJax#14 I was doing early hookMath() and postponing renderAllMath() on the theory "Queuing this allows text to appear before math." But doing hookMath() before firepad load already renders all math, and renderAllMath() does all the work again because there is no caching (cben/CodeMirror-MathJax#15).
Using MJ 2.5 is blocked on fixing #33. => I think KaTeX with MJ fallback (or KaTeX as preview with MJ re-rendering everything?) is the better solution. |
Example of viewport-driven typesetting: https://github.com/Dashed/mathjax-lazyload |
"The upcoming MathJax 2.6 release will bring the CommonHTML output to the quality of the HTML-CSS output." |
[migrated from cben/mathdown#19]
The initial render on document load is horribly unacceptably slow (saw 1 minute on a math-heavy page on mathdown.net).
The unrendered text does show very fast but it's not very useful since the editor is paralyzed until all math is rendered.
Verified that loading MathJax from the network is not the blocker; it's the rendering itself.
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.
[EDIT: Indeed, switching Mathdown to fixed size helped a lot https://github.com/cben/mathdown/commit/bc6c5c935905cfa012df718666018416a93b9715]
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.operation
don't help because post-Typeset callbacks come one by one.I guess CM's input polling doesn't get much chance to run.
next steps:
cm.operation
.P.S. Relevant existing bug:
The text was updated successfully, but these errors were encountered: