Hacker News new | ask | show | jobs
by quotemstr 1681 days 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-t...

3 comments

I 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.
Ha, hearing the word "process" in Wolfram's voice, there.
Big fan! No, I mean Stephen Wolfram is a big fan… of Stephen Wolfram
> 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/Over...

[1] https://reference.wolfram.com/language/guide/CLanguageInterf... (a lot of the paclets are bindings for C libraries too)

Mathematica 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.