3 ms·
> I've had the displeasure of porting 4k sloc of Mathematica to python and the script runtime went from 40min to 5sec While i can't comment on perf, how much o
by maccard 5y ago
> I've had the displeasure of porting 4k sloc of Mathematica to python and the script runtime went from 40min to 5sec
While i can't comment on perf, how much of this is due to a rewrite taking advantage of knowledge learned? Would a rewrite in mathematica have been quicker than 40m?
- carry_bit 5y agoI'd wonder if the Mathematica code was using fast constructs to begin with. It's best to think of Mathematica as being similar to Python + Numpy. If you want your code to be fast, you want to spend as much time in the kernel (Numpy) as possible. That's why you'll want to take advantage of functional programming constructs, listable functions, etc. if you want to write fast Mathematica code.