Is there a way to relieve the pressure on the browser with many mathjax equations?

Is there a way to relieve the pressure on the browser with many mathjax equations?

Hi, I’m doing math in my discourse, with many equations, thanks to this plugin, it works very fine in my discourse.

But, as my article grows longer, with about 30 equations, the browser seems to be working very hard, the fan of my computer is blowing, the webpage appears to be reacting quite slowly, and pressing any button on my keyboard will have to wait a long time to see the reaction.

So I think it must be because I’m using too many equations, but my math equations are not ignorable :joy: , I can’t delete most of them.

So I’m wondering, whether we can have a mode, where the math equations plugin mathjax is not working instantly, it can parse the equation every 10 seconds, or only after I have uploaded the full reply. Or can we set an automatic switch, if there are only less than 10 equations in a reply, mathjax will work instantly, while not, it will work reluctantly?

I’m discussing possible ways to improve this plugin with @joffreyjaffeux, and I think our current plan may help with performance too.

2 Likes

Have you tried switching from MathJax to KaTeX? (In plugin settings) It should be much much faster.

Last time I’m using Katex, someone told me that MathJax is much faster than KaTex :rofl:

So, I’m wondering whether you have the proof, which one is much faster and robust?

They were probably talking about MathJax version 3.3, which certainly can be faster than KaTeX in some situations. The Math Plugin, though, uses MathJax V2.7, which is generally much slower than KaTeX.

Of potentially more importance is the fact that all versions of MathJax are much more feature rich compared to KaTeX. If you switch to KaTeX, you lose the contextual menu provided by MathJax, which is a deal breaker for me. MathJax also provides multiple input (TeX, AsciiMath, MathML) and output (HTML, SVG) forms.

@Falco I think the right way to improve the plugin is to upgrade the MathJax version to the latest version 3. I don’t think it’s particularly trivial, though, since the API has changed significantly. On the bright side, I think the new API is a vast improvement, though not yet well documented.

1 Like

I think I found the way!

Just shut down the preview window, the pressure will be much lower, and works good.

If you want to check the preview, turn it on for a while and shut it down immediately.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.