3 ms·
> Takes about 5-20 seconds to load a page on my 1Gb fiber connection Wolfram Alpha is implemented in Mathematica, which --- to understate the situation --- was
by quotemstr 5y ago
> Takes about 5-20 seconds to load a page on my 1Gb fiber connection
Wolfram Alpha is implemented in Mathematica, which --- to understate the situation --- was never intended as a high performance backend server language. I suspect that's the reason for the bad performance.
"As a result, the five million lines of Mathematica code that make up Wolfram|Alpha are equivalent to many tens of millions of lines of code in a lower-level language like C, Java, or Python." [1]
Sure, there's something to be said for implementing logic in high-level code, but without a plan for lowering that high-level logic to machine code in a way that performs well, you're setting yourself up for long-term pain.
[1] https://blog.wolframalpha.com/2009/05/01/the-secret-behind-the-computational-engine-in-wolframalpha/ https://blog.wolframalpha.com/2009/05/01/the-secret-behind-t...
- vortico 5y agoI doubt the bad performance is due to evaluating expressions itself. If I type N[Log[2]] into Mathematica, it evaluates in less than a millisecond. It's probably because Wolfram Alpha is using natural language process to try to process my query and then finally deciding that by N[Log[2]], I mean N[Log[2]]. And it's probably not because of that, but because their grid scheduler isn't optimized for sub-second latency.
- nhammond 5y ago> Sure, there's something to be said for implementing logic in high-level code, but without a plan for lowering that high-level logic to machine code in a way that performs well, you're setting yourself up for long-term pain. Whatever the reason for the performance issue (I don't know enough about WA to speculate what/why/how), I feel like noting the existence of the wolfram compiler[0] and the various language interfaces[1]. Anyone interested in using Mathematica/WL might get a kick out of exploring those more, at the very least. [0] https://reference.wolfram.com/language/Compile/tutorial/Overview.html https://reference.wolfram.com/language/Compile/tutorial/Over... [1] https://reference.wolfram.com/language/guide/CLanguageInterface.html https://reference.wolfram.com/language/guide/CLanguageInterf... (a lot of the paclets are bindings for C libraries too)
- Banana699 5y agoMathematica is extremely performant for most of the built-ins, the overhead of interpretation is nearly negligible for all but the tiniest operations. There is also no reason to think that their request-response boilerplate is written in Mathematica, Mathematica is fully integrated with a lot of languages and runtimes.