Alright, let me qualify my statement. The HTTP request/response time to fetch the .js file will happen after the page is loaded, as will the parsing and execution of it. This is an improvement over putting it in the head of the page.
The time you’re concerned about is the time for actually running the math typesetting code. Because the browser’s JavaScript execution model is blocking and single-threaded (at least until we get web workers widely supported), a non-trivial computation can cause a hiccup in initial page performance.
This is mitigated somewhat if you tend to open new pages in a background tab and look at them later (as I do), and you use a browser like Chrome which runs a separate process per tab, since by the time you look at the page it will have settled down.
On my machine, the MathJax web site loads very quickly, and the math is processed almost instantly after the script is in the browser cache. This does not noticeably affect the site’s speed or responsiveness.
As for memory usage, according to my informal benchmarks, the memory cost of loading some JavaScript code is actually very small. It’s dwarfed by the memory cost of rendering the HTML and images and such.
Yesterday I found myself composing a reply to LW in one tab while using 2 other tabs to look up text and URLs so I could paste them into my reply. If I understand what you want correctly, MathJax would have run in all 3 of the tabs (even with Chrome’s process-per-tab architecture) and the delays and pauses in things like scrolling would have had a chance to interrupt my train of thought.
Also, some of us have tried Chrome and after consideration, decided it is worse than what we are currently using. Google’s motive in introducing Chrome was to neutralize the threat to its revenue stream posed by Microsoft’s Bing and other Microsoft initiatives by undermining Office and desktop software sales in general, which is very different from my main motivation for using a web browser, which is to have a quick and reliable and non-glitchy and non-crash-prone way read words (and math symbols) written by many others and write words (and math symbols) that will be read by many others.
according to my informal benchmarks, the memory cost of loading some JavaScript code is actually very small
There is no upper bound on the memory cost or time cost of loading a file of JavaScript, as is true of any Turing-complete programming language. With this particular JavaScript file, I worry about time cost more than memory cost because I can imagine that it converts LaTeX to images in the browser and doing that conversion in an interpreted language seems time-intensive.
In summary, what you write leads me to believe that although a few LWers might like MathJax here, you do not really know whether it will have adverse effects on the majority of LWers.
Note that these adverse effects might be diffuse (meaning they worsen the user experience of many people just a little) and difficult for the average LWer to attribute to MathJax—just as it was difficult for me to attribute my frustration to Google Analytics’s JavaScript until I made the experiment of preventing it from loading.
ADDED.
I would be interested in your answer to my question bottom of grandparent.
Moreover, I am curious as to the source or cause of your enthusiasm for LaTeX on Less Wrong. A lot of people here are in the habit of reading the output of LaTeX (printed on paper) since it is used for most math papers and many (most?) science papers. I suppose you are one of them; aren’t you? Are you also in the habit of writing LaTeX?
Also, I should warn you that as a general rule, I tend not to continue threads that consists of just 2 people replying back and forth more than 3 reply-counterreply cycles deep unless the thread gets upvoted a lot. I mention this so that you do not write a long reply to this and then get disappointed when I do not reply or reply with just a summary of my position.
Yesterday I found myself composing a reply to LW in one tab while using 2 other tabs to look up text and URLs so I could paste them into my reply. Under your proposal, MathJax would run in all 3 of the tabs even with Chrome’s process-per-tab architecture, and when I needed a page, I needed it now and having to wait for it would have interrupted my train of thought.
How old is your machine? My computer is aging and creaky, and it can easily handle MathJax running in several tabs without any slowdown that I’ve been able to notice. In particular, any slowdown on page load is so slight that I haven’t been able to see it.
There is no upper bound on the memory cost of loading a file of JavaScript, as is true of any Turing-complete programming language.
I was referring to the memory cost of loading the code itself, not of the heap memory which the program may allocate, which obviously will vary from minuscule to infinite depending on the program.
Does this particular JavaScript file not convert LaTex code into images?
No, it doesn’t produce images. It generates HTML and CSS, which looks better and is a lot nicer for people wanting to increase the font size.
I notice you have not answered the direct question at the bottom of grandparent.
You mean this one? It must have slipped my mind:
ADDED. Those in favor of MathJax: do you want it for comments or just for top-level posts?
I want it for both comments and top-level posts. Why not?
I am using a first-gen MacBook, the model that was introduced May 2006, with 1 gig RAM.
When someone else wrote yesterday that Math Overflow “has LaTeX support” I went there and looked at a random page with math on it—but maybe MO does not use MathJax, so it would help the conversation for you to provide URL of a page that uses MathJax.
It looks like you’ve expanded your post after I replied, so here’s an addendum.
Moreover, I am curious as to the source or cause of your enthusiasm for LaTeX on Less Wrong. A lot of people here are in the habit of reading the output of LaTeX (printed on paper) since it is used for most math papers and many (most?) science papers. I suppose you are one of them; aren’t you? Are you also in the habit of writing LaTeX?
I’m used to reading and writing LaTeX, yes. The source of my enthusiasm for it comes in two parts:
Because occasionally I want to be able to write math in comments, and the LaTeX syntax for this is the least horrible (and most widely known) that I know of. Simple ASCII formatting is better than nothing, but only goes so far.
I’m sure other people would also like to be able to write math in comments, with formatting that doesn’t suck. For my part, I would like to be able to read their math with decent formatting.
Alright, let me qualify my statement. The HTTP request/response time to fetch the .js file will happen after the page is loaded, as will the parsing and execution of it. This is an improvement over putting it in the head of the page.
The time you’re concerned about is the time for actually running the math typesetting code. Because the browser’s JavaScript execution model is blocking and single-threaded (at least until we get web workers widely supported), a non-trivial computation can cause a hiccup in initial page performance.
This is mitigated somewhat if you tend to open new pages in a background tab and look at them later (as I do), and you use a browser like Chrome which runs a separate process per tab, since by the time you look at the page it will have settled down.
On my machine, the MathJax web site loads very quickly, and the math is processed almost instantly after the script is in the browser cache. This does not noticeably affect the site’s speed or responsiveness.
As for memory usage, according to my informal benchmarks, the memory cost of loading some JavaScript code is actually very small. It’s dwarfed by the memory cost of rendering the HTML and images and such.
Yesterday I found myself composing a reply to LW in one tab while using 2 other tabs to look up text and URLs so I could paste them into my reply. If I understand what you want correctly, MathJax would have run in all 3 of the tabs (even with Chrome’s process-per-tab architecture) and the delays and pauses in things like scrolling would have had a chance to interrupt my train of thought.
Also, some of us have tried Chrome and after consideration, decided it is worse than what we are currently using. Google’s motive in introducing Chrome was to neutralize the threat to its revenue stream posed by Microsoft’s Bing and other Microsoft initiatives by undermining Office and desktop software sales in general, which is very different from my main motivation for using a web browser, which is to have a quick and reliable and non-glitchy and non-crash-prone way read words (and math symbols) written by many others and write words (and math symbols) that will be read by many others.
There is no upper bound on the memory cost or time cost of loading a file of JavaScript, as is true of any Turing-complete programming language. With this particular JavaScript file, I worry about time cost more than memory cost because I can imagine that it converts LaTeX to images in the browser and doing that conversion in an interpreted language seems time-intensive.
In summary, what you write leads me to believe that although a few LWers might like MathJax here, you do not really know whether it will have adverse effects on the majority of LWers. Note that these adverse effects might be diffuse (meaning they worsen the user experience of many people just a little) and difficult for the average LWer to attribute to MathJax—just as it was difficult for me to attribute my frustration to Google Analytics’s JavaScript until I made the experiment of preventing it from loading.
ADDED.
I would be interested in your answer to my question bottom of grandparent.
Moreover, I am curious as to the source or cause of your enthusiasm for LaTeX on Less Wrong. A lot of people here are in the habit of reading the output of LaTeX (printed on paper) since it is used for most math papers and many (most?) science papers. I suppose you are one of them; aren’t you? Are you also in the habit of writing LaTeX?
Also, I should warn you that as a general rule, I tend not to continue threads that consists of just 2 people replying back and forth more than 3 reply-counterreply cycles deep unless the thread gets upvoted a lot. I mention this so that you do not write a long reply to this and then get disappointed when I do not reply or reply with just a summary of my position.
How old is your machine? My computer is aging and creaky, and it can easily handle MathJax running in several tabs without any slowdown that I’ve been able to notice. In particular, any slowdown on page load is so slight that I haven’t been able to see it.
I was referring to the memory cost of loading the code itself, not of the heap memory which the program may allocate, which obviously will vary from minuscule to infinite depending on the program.
No, it doesn’t produce images. It generates HTML and CSS, which looks better and is a lot nicer for people wanting to increase the font size.
You mean this one? It must have slipped my mind:
I want it for both comments and top-level posts. Why not?
I am guessing that you, sketerpot, are in the habit of reading a lot of formulae produced by LaTeX and writing a lot of LaTeX. Is that so?
I am using a first-gen MacBook, the model that was introduced May 2006, with 1 gig RAM.
When someone else wrote yesterday that Math Overflow “has LaTeX support” I went there and looked at a random page with math on it—but maybe MO does not use MathJax, so it would help the conversation for you to provide URL of a page that uses MathJax.
MathOverflow does use MathJax, actually; math.stackexchange as well.
For a specific example, try this question on Math Overflow. It has quite a bit of LaTeX math.
It looks like you’ve expanded your post after I replied, so here’s an addendum.
I’m used to reading and writing LaTeX, yes. The source of my enthusiasm for it comes in two parts:
Because occasionally I want to be able to write math in comments, and the LaTeX syntax for this is the least horrible (and most widely known) that I know of. Simple ASCII formatting is better than nothing, but only goes so far.
I’m sure other people would also like to be able to write math in comments, with formatting that doesn’t suck. For my part, I would like to be able to read their math with decent formatting.
Pretty straightforward motives, I would think.