Here we show FriCAS version of benchmark presented at http://cosmosimple.blogspot.de/2013/12/some-benchmarks-of-mathematica-vs.html fricas do_sum(x, Type: Voidfricas )set messages time on fricas )set output tex off fricas )set output algebra on fricas Compiling function do_sum with type (DoubleFloat, Type: DoubleFloat?fricas Time: 0.57 (EV) + 0.04 (OT) = 0.61 sec The original article gives the following execution times for 10^8 iterations: 2320s (estimated) for normal Mathematica code (180s with underflow checking turned off), 6.80s for Mathematica code compiled to VM, 1.04s for Mathematica code compiled to C, 0.66s for native C code, 702s for Maxima, 59.6s for Python. The article did not not specify machine speed, but detail suggest it was a fast one. So we can can infer that FriCAS performs quite well on this benchmark, probably slower than compiled Mathematica code, but better than interpreted system. Note that FriCAS time includes compilation time. Note1: There are several flaws in this benchmark. Fist, it operates on
extremally small numbers, systems which catch underflow may be unfairly
punished (as is the case with default Mathematica timing). Second,
the computation is purely numeric, while we should compare symbolic
capabilities. Third, most of actual computation should be spent
in library calls Note2: This is also shows that types lead to better execution speed: FriCAS knows types so can use faster specialized routines, instead of dispatching on types. Also, we specified argument to be DoubleFloat?. Otherwise FriCAS would perform calculations using Float, which has arbitrary precision but is implemented entirely is software, so is much slower than DoubleFloat?. |