On Mon, Feb 8, 2010 at 10:13 PM, Nils Bruin <[email protected]> wrote:
> Finally we got to the cool stuff of running maxima in an embedded
> lisp: direct expression tree translation between SR and maxima. See:
> http://trac.sagemath.org/sage_trac/ticket/7377
> Timing improvements are disappointingly little: The translation of the
> expressions simply isn't all that big of a bottle neck. Example:
>
> (new timings)
>
> sage: timeit("integral(cos(x),x)")
> 625 loops, best of 3: 1.1 ms per loop
>
> (old timings)
>
> sage: timeit("integral(cos(x),x)")
> 25 loops, best of 3: 8.08 ms per loop
A factor of nearly ten speedup is pretty impressive!
> sage: timeit("integral(cos(x^2),x)")
> 5 loops, best of 3: 37 ms per loop
>
> I expect that the new interface should be much more frugal with
> memory, though. I don't think the maxima expect interface ever deletes
> old results,
Yes it does.
sage: a = maxima(2^999)
sage: a.name()
'sage4'
sage: maxima('sage4')
5357543035931336604742125245300009052807024058527668037218751941851755255624680612465991894078479290637973364587765734125935726428461570217992288787349287401967283887412115492710537302531185570938977091076523237491790970633699383779582771973038531457285598238843271083830214915826312193418602834034688
sage: del a
sage: maxima('sage4')
sage4
Whenever an object created using the Maxima (or any pexpect!)
interface goes out of scope, maxima.clear is called on it, which does:
self._expect.send('kill(%s)$'%var)
> whereas the new interface is completely permissive of ECL
> garbage collecting unreferenced structures. It still uses the string-
> based interface to bootstrap its translation dictionaries and for sage
> types it doesn't have its own translation methods for, though, so some
> memory is lost there.
Lost or used? I.e., is this a memory leak or just that some memory is used.
William
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org