4 ms·
Since Julia is about speed, how does this compare to Sympy speed?
by IndianAstronaut 11y ago
Since Julia is about speed, how does this compare to Sympy speed?
- zokier 11y agoThey have a benchmarks page where it compares quite favorably to SageMath. I don't know but I'd kinda assume that Sage uses Sympy under the hood.
- fdej 11y agoSage doesn't really use SymPy a whole lot. Most of the core algebra in Sage is based on C libraries like MPIR, Flint, Singular, Pari... Nemo uses some of the same libraries under the hood, but there's much less overhead. This is in part due to Julia being faster than Python (although Sage works around that to some extent by using Cython), and in part due to Nemo using tighter algorithms/code. Note that Nemo is currently more geared towards purely algebraic computation, though. It doesn't currently have S-expressions with support for symbolic integration and the like (Sage mostly uses Pynac and Maxima for this).
- fdej 11y agoNot necessarily the most representative benchmark, but: >>> from sympy import * >>> from time import clock >>> var('x y z t') (x, y, z, t) >>> f = poly(1 + x + y + z + t) >>> p = f ** 20 >>> t1=clock(); q=p*(p+1); clock()-t1 53.828634 julia> using Nemo julia> Rx,x=PolynomialRing(ZZ,"x"); julia> Ry,y=PolynomialRing(Rx,"y"); julia> Rz,z=PolynomialRing(Ry,"z"); julia> Rt,t=PolynomialRing(Rz,"t"); julia> p = (1+x+y+z+t)^20; julia> @time p*(p+1); 1.593379 seconds (129.24 k allocations: 6.758 MB, 0.82% gc time) Edit: oops, I forgot a variable which made the benchmark totally unfair!
- srean 11y ago> Since Julia is about speed Is it ? At least that's not the part that excites me most, although its a nice by product to have. Its a nice flexible language with good syntax and a good set of features. I still dislike 1 based indexing though.
- IndianAstronaut 11y agoI honestly see little reason for its existence besides speed. R and Python are very well established.