KaTeX vs MathJax vs Mathquill (v9)

Revision 9 of this benchmark created by Eric on


Preparation HTML

<link href="http://xymostech.com/katex/katex.min.css" rel="stylesheet" type="text/css">
<link href="http://xymostech.com/katex/fonts/fonts.css" rel="stylesheet" type="text/css">
<link href=""https://www.desmos.com/assets/vendor/mathquill/mathquill.css" rel="stylesheet" type="text/css">
<script src="http://xymostech.com/katex/katex.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&delayStartupUntil=configured"></script>
<script src="https://www.desmos.com/assets/vendor/mathquill/mathquill.js"></script>

<script>
MathJax.Hub.Config({skipStartupTypeset: true});
MathJax.Hub.Configured();
</script>

<div id="math"></div>

Setup

var math = document.getElementById("math");
    var formula = "\\dfrac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}";

Teardown


    math.innerHTML = "";
  

Test runner

Ready to run.

Testing in
TestOps/sec
KaTeX
katex.process(formula, math);
math.outerWidth;
ready
MathJax
// async test
math.innerHTML = "<script type='math/tex'>" + formula + "</script>";
MathJax.Hub.Queue(["Process", MathJax.Hub, math]);
MathJax.Hub.Queue(function() {
  math.outerWidth;
  deferred.resolve();
});
ready
Mathquill
$(math)
  .mathquill('latex', formula)
  .on('render', function() {
    math.outerWidth;
    deferred.resolve();
  });
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.