On Aug 24, 7:55 am, Robert Dodier <robert.dod...@gmail.com> wrote:
> The #$ macro constructs a string input stream and eventually
> calls ADD-LINEINFO so it suffers from the bug I mentioned in
> a previous message.

The $NOLABELS variable seems to live in local scope somewhere, and
hence setting it does not affect the detoriation in the #$...$ macro:

with the following code (which just calls the #$...$ macro a lot):

from sage.libs.ecl import *
init_ecl()
ecl_eval("(require 'asdf)")
ecl_eval('(load "%s")'%(SAGE_ROOT+"/local/lib/maxima/maxima.fasb"))
ecl_eval('(in-package :maxima)')
ecl_eval('(setq $nolabels t))')
def libadd(a,b):
    return eval(str(ecl_eval('(MEVAL #$ %s + %s$)'%(a,b))))

sage: timeit("libadd(1,2)")
625 loops, best of 3: 192 µs per loop
sage: timeit("libadd(1,2)")
625 loops, best of 3: 654 µs per loop
sage: timeit("libadd(1,2)")
625 loops, best of 3: 1.51 ms per loop
sage: timeit("libadd(1,2)")
125 loops, best of 3: 1.85 ms per loop
sage: timeit("libadd(1,2)")
125 loops, best of 3: 1.94 ms per loop
sage: timeit("libadd(1,2)")
125 loops, best of 3: 2.02 ms per loop
sage: timeit("libadd(1,2)")
125 loops, best of 3: 2.13 ms per loop
sage: timeit("libadd(1,2)")
125 loops, best of 3: 2.23 ms per loop
sage: ecl_eval('$nolabels')


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to