Some time ago, I thought about integrating LaTeX into user-facing software, not to render an entire web page but to generate a few formulas and images containing formulas in real-time or close to real-time. It breaks my heart to say that it seems impossible to do so, because LaTex is soooo slow.
The codebase is written in an obscure language (that Knuth created for the purpose?) and would have to be converted to something optimizable such as C in order to become faster.
Since I won't be re-implementing LaTex soon, I'll stick with MathJax for simple formulas and must look for something else if I want to create a complicated formula-containing image.