javascriptperformancemathjaxkatexmathquill

compare performance MathJax vs MathQuill vs Katex


I'm looking for the fastest way to create formules inside a web page.

I thought I found the solution on jsperf in which MathQuill is by far the quickest. After I studied the tests a bit I noticed that the test for MathQuill runs in sync-mode, but it had an async setup. However, if you check the async checkbox, MathQuill will never fire the render event and thus the test will never complete.

So the questions is, is MathQuill async ? And is this is good performance test ? And is there maybe a better formula renderer ?


Solution

  • So the questions is, is MathQuill async?

    Based on the MathQuill source, it renders elements on document ready, synchronously, but it can also render elements on the fly, through the .mathquill() API. Technically though, you could call the method yourself and do it asynchronously.

    And is this is good performance test?

    I can't really speak to the usefulness of the test because it's unclear what you're trying to do, but I can provide you with some general background on the issue.

    MathQuill's main strength is the ability to render math on the fly, with pretty, user-friendly textboxes. They themselves admit that it's not a good option for rendering static math, due to it's limited LaTeX support.

    KaTeX, according to most benchmarks I've seen, is faster than MathJax, by a long shot. However, it has somewhat incomplete support for LaTeX, so that may be an issue.

    MathJax is pretty slow, relative to the others, but it has almost complete support for LaTeX. If that's the price you're willing to pay, then go for it.

    In short, choose MathQuill for editing, KaTeX for speed, for MathJax for comprehensiveness.

    And is there maybe a better formula renderer?

    These three are the only ones I've heard of. Based on a previous question, the only other option is jsMath, MathJax's predecessor. It's from 2004, so there's no reason that you should use it.