Skip to content
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

Speed test doesn't work #420

Closed
astoilkov opened this issue Dec 22, 2015 · 12 comments
Closed

Speed test doesn't work #420

astoilkov opened this issue Dec 22, 2015 · 12 comments

Comments

@astoilkov
Copy link

It fails with:

Uncaught ReferenceError: MathJax is not defined.

message: Uncaught ReferenceError: MathJax is not defined
fileName: https://jsperf.com/katex-vs-mathjax
lineNumber: 129
@edemaine
Copy link
Member

edemaine commented Jan 2, 2017

Just bumped into this as well. The problem is this code in the speed test:

<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">
<script src="http://xymostech.com/katex/katex.min.js"></script>

It would work if it could be changed to:

<link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/fonts.css" rel="stylesheet" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js"></script>

@kevinbarabash
Copy link
Member

Looks like someone made the proposed changes in https://jsperf.com/katex-vs-mathjax/47. It's still not working, but it looks like an unrelated issue in the setup code.

@oddhack
Copy link

oddhack commented Jan 5, 2017

Perhaps this link could be removed from the README until it's working - I just ran into this as well (also giving a "ReferenceError: katex is not defined" as well as the MathJax error).

@mbourne
Copy link

mbourne commented Jan 5, 2017

<shamelessplug>
In the meantime, here's my KaTeX-MathJax speed comparison: http://www.intmath.com/cg5/katex-mathjax-comparison.php
</shamelessplug>

@kevinbarabash
Copy link
Member

@mbourne would you be okay with us pointing to your speed comparison in the README?

@edemaine
Copy link
Member

edemaine commented Jan 5, 2017

@mbourne Great examples! (And wow, what a speedup -- I get 25x on desktop and 50x on mobile.) Helpful also to have the bad examples.

I tried the cross product example and, while it indeed looks bad in KaTeX and good in MathJax, it actually looks the same as KaTeX in PDFLaTeX. (See also #594.) Another solution would be to change the \\ into \\[0.5ex] for example, which works in LaTeX and KaTeX (didn't try MathJax).

On the other hand, Maxwell's Equation looks much better in LaTeX than KaTeX, so that's a bug (#531).

\overrightarrow is coming soon, I hope (#524). \underset seems feasible, but no concrete plans yet (#484).

@stevem6
Copy link

stevem6 commented Jan 5, 2017

Maxwell's Equations look fine with extra vertical spacing eg using \\ \\. See IntMath Samples option at http://sixthform.info/katex/examples/demo.html
I also used different (and variable) vertical spacing for the Cross Product, but then I expect to do that sort of adjustment in LaTeX when using fractions in matrices or align environments etc, so I'm not bothered by the need to do so in KaTeX.

@mbourne
Copy link

mbourne commented Jan 6, 2017

@kevinbarabash: Feel free to include it in the README.

@edemaine: Thanks for your kind comments.

@reagle
Copy link

reagle commented Jan 20, 2017

I just tried the online version http://jsperf.com/katex-vs-mathjax/ and it fails. I'm a newbie, but this looks bad for your project when your own test can't complete!

Testing in Chrome 55.0.2883 / Mac OS X 10.11.6

gagern pushed a commit that referenced this issue Jan 20, 2017
Permission to reference page granted in
#420 (comment)
@kevinbarabash
Copy link
Member

Now that we're pointing to http://www.intmath.com/cg5/katex-mathjax-comparison.php in the README maybe we should delete the jsperf test.

@edemaine
Copy link
Member

Oh, do you have access to change the jsperf test? I thought we had to make a new one. I think jsperf would be better/good in addition -- it has trustworthy measurement technology.

@kevinbarabash
Copy link
Member

I can't get jsperf.com to even load. If it comes back online we can re-open this and try to figure out how to update the perf test. If we're concerned about accuracy of the new katex-mathjax comparison we might look at using https://github.com/bestiejs/benchmark.js (this is what jsperf uses), but the difference in speed right now is at least an order of magnitude so I wouldn't bother.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants