On Dec 27, 9:57 pm, "Mike Hansen" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> The reason why the symbolic stuff in Sage is slow is that it uses a
> psuedo-tty interface to talk to Maxima.  There is a lot of overhead
> with this due to  waiting, synchronization, parsing the string output,
> etc.  One way to get the symbolic stuff to be faster is to make using
> Sympy since it won't have that overhead (even though it is slower than
> native maxima at the moment).

It's indeed 7x faster in SymPy:

In [2]: time sum(((x+sin(i))/x+(x-sin(i))/x).expand() for i in
xrange(100))
CPU times: user 0.54 s, sys: 0.00 s, total: 0.54 s
Wall time: 0.54
Out[2]: 200

than in Sage:

sage: time sum(((x+sin(i))/x+(x-sin(i))/x).rational_simplify() for i
in xrange(100))
CPU times: user 0.60 s, sys: 0.24 s, total: 0.85 s
Wall time: 3.92
200

However, when SymPy is used inside Sage:

sage: from sympy import sympify
sage: x = sympify(x)
sage: time sum(((x+sin(i))/x+(x-sin(i))/x).expand() for i in
xrange(100))
CPU times: user 2.49 s, sys: 0.48 s, total: 2.97 s
Wall time: 6.88
200

It's actually twice slower than Sage+Maxima. Probably some unnecessary
conversions are happening in there.

We also have a project sympycore, as a playground of new ideas, that
we then want to incorporate in SymPy and that one is 23x faster than
Sage:

In [4]: time sum(((x+Sin(i))/x+(x-Sin(i))/x).expand() for i in
xrange(100))
CPU times: user 0.17 s, sys: 0.00 s, total: 0.17 s
Wall time: 0.17
Out[4]: 200


So definitely we are working on improving this, but it will take some
time, before Sage can do this by default.


Ondrej
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to