Slow rendering of maths by 2.1

241 views
Skip to first unread message

s.rama...@ymail.com

unread,
Oct 28, 2012, 12:21:59 PM10/28/12
to mathja...@googlegroups.com
Hi math equations on my site are being rendered by mathjax 2.1 cdn.  I feel this process is a bit slow.  I recorded a video, to give a clear indication of whether it is really loading slow or only on my machine it is loading slow.. 
I use W7, Chrome 22.0.1229.94 m version.
Is there any way we can increase the page load time and math processing speed?  
I use blogger. 

Recorder url:

Thanks in advance
Ramakrishna

Davide P. Cervone

unread,
Oct 28, 2012, 8:26:07 PM10/28/12
to mathja...@googlegroups.com
Well, you could avoid one file transfer by using config=TeX-AMS_HTML-full rather than config=TeX-AMS_HTML, which would help a bit.  You could also have your readers install the STIX or MathJax fonts on their computers to avoid having to download the web fonts, but that may not be something you want them to have to do.  Note that the first page viewed will be the slowest, as later pages should find most of MathJax already in the browser cache, and so the files won't have to be loaded over the network again.  Another alternative would be to use SVG output rather than HTML-CSS, as the SVG rendering is often faster (especially on pages with lots of math).  Other than that, I don't see anything to suggest.

Davide

Murray

unread,
Feb 1, 2013, 2:33:19 AM2/1/13
to mathja...@googlegroups.com
Davide

webpagetest.org indicates that MathJax assets have a very short cache life, and so while any one visit of a few pages will "find most of MathJax already in the browser cache" for the second page onward, subsequent visits even an hour later require another round of downloads:

FAILED - (15.5 minutes) - http://cdn.mathjax.org/mathjax/latest/images/MenuArrow-15.png
FAILED - (20.0 minutes) - http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Size1-Regular.woff
FAILED - (20.5 minutes) - http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Main-Regular.woff
FAILED - (26.9 minutes) - http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Main-Bold.woff
FAILED - (29.9 minutes) - http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Size4-Regular.woff
FAILED - (32.1 minutes) - http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_HTMLorMML
FAILED - (41.1 minutes) - http://cdn.mathjax.org/mathjax/latest/jax/element/mml/optable/Latin1Supplement.js
FAILED - (42.2 minutes) - http://cdn.mathjax.org/mathjax/latest/jax/output/HTML-CSS/jax.js
FAILED - (45.9 minutes) - http://cdn.mathjax.org/mathjax/latest/config/AM_HTMLorMML.js
FAILED - (47.0 minutes) - http://cdn.mathjax.org/mathjax/latest/jax/output/HTML-CSS/fonts/TeX/fontdata.js
FAILED - (49.3 minutes) - http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/woff/MathJax_Math-Italic.woff

I'm wondering why that is? I expect the majority of the above items would not change much (especially the fonts) and even the "latest" MathJax.js would not hurt if it was say a week old (developers know to do a full reload if new versions are announced).

Regards
Murray

Murray

unread,
Feb 11, 2013, 2:53:59 AM2/11/13
to mathja...@googlegroups.com
Davide

** Gentle bump **

I didn't get a reply to this. Should I have posted it in the dev group?

It seemed to be relevant to this discussion.

Regards

Murray

Davide P. Cervone

unread,
Feb 11, 2013, 6:59:04 AM2/11/13
to mathja...@googlegroups.com
I was able to confirm that the times were very short for me as well, and have passed that on to the people who maintain the CDN.  I haven't heard back.  I'll pass the bump on to them.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Peter Krautzberger

unread,
Feb 11, 2013, 11:25:25 PM2/11/13
to mathja...@googlegroups.com
Sorry, Murray. I missed the original posting. I've looked into it and it seems like the TTL was only 1h. I'm not sure what happened there, but I set it to 168h. Let me know if you continue to experience this; shoudn't take more than 2h to see the change.

Sorry for the inconvience,
Peter.

Murray

unread,
Feb 12, 2013, 7:12:53 AM2/12/13
to mathja...@googlegroups.com
No problem, Peter

Yeah, it's great now. Thanks a lot.

All the best.

Murray

Peter Krautzberger

unread,
Feb 12, 2013, 8:00:35 AM2/12/13
to mathja...@googlegroups.com

Glad it works now. I'll keep an eye on it to make sure it was just human error, not a bug. Thanks again for reporting it!

Peter.

Murray

unread,
May 6, 2013, 2:49:01 AM5/6/13
to mathja...@googlegroups.com
Hi again

I noticed some slow page loads and long waits for fonts once again recently.

Seems like the short cache times have returned. Just now:

Peter Krautzberger

unread,
May 6, 2013, 2:53:53 AM5/6/13
to mathja...@googlegroups.com
Yes, this is because of the ongoing beta phase. It will be changed back to 7 days after the release goes out in two weeks. Sorry for the inconvenience. We plan to find a workaround for the next release cycle.

Peter.

Murray

unread,
May 23, 2013, 11:11:08 PM5/23/13
to mathja...@googlegroups.com
Hi Peter

I note the cache times are still low and it's now more than 2 weeks since the release:


Once the fonts are in cache it shaves a good 5 seconds off the time for the page I'm testing to be fully loaded.

Would I be correct to say the woff fonts don't change much over time, and so should remain with a 7-day cache setting (or even longer) whether or not the main JS is updated?

Thanks and regards

Murray

Peter Krautzberger

unread,
May 24, 2013, 12:21:11 AM5/24/13
to mathja...@googlegroups.com
Hi Murray,

We only increased the TTL on Tuesday (because increasing it means reducing our response time for hotfixes). It should be 24h right now, so I don't know why you're seeing what you're seeing. It will go up to 1 week again by next week. We currently don't control the TTL on a file level and we plan to find a better strategy for the next release. 

Sorry for the inconvenience.
Peter.

PS: The official v2.2 release was a week ago. During most the beta run, the TTL was at 24h.

Murray

unread,
May 24, 2013, 12:44:54 AM5/24/13
to mathja...@googlegroups.com
Thanks a lot, Peter. Sorry to be a pest.

My observation/request about the fonts was because I normally point to the "latest" directory. To try to beat the slow page load times, I rolled back to earlier versions but still found short cache times on the fonts that were coming down the pipe.

So there didn't seem to be a way to speed things up. If the fonts always have long cache times, this would not be such a problem.

Regards
Murray

Peter Krautzberger

unread,
May 24, 2013, 12:53:46 AM5/24/13
to mathja...@googlegroups.com
No problem at all, Murray. Thanks for pointing out the weird behavior. I have a few ideas how we might be able to work around the current issues, but I'll have to do some testing. Since Rackspace does not allow edge purges, a long TTL means we can't easily update things (like critical bug fixes), that's why we reduce things during release times. But I think we can do better.

Peter.
Reply all
Reply to author
Forward
0 new messages