[CM] Performance of S7

Massimiliano Gubinelli m.gubinelli at gmail.com
Sat Jan 2 08:13:11 PST 2021

Glad to be of help. :)

I've made some progress on my side. I was looking at the way c_function_is_ok works and I noticed that globally defined symbols have a preferred treatment, so I modified tm-define in order to introduce the new bindings in (rootlet) and not in *texmacs-module* (a sublet of rootlet) and it indeed improved the runtime of menu-expand of 10x, bringing back usual performance of TeXmacs. So it seems there is some hope :)

Guile 1.8 runs the tm-defined (fib 30) test in 1770 msec while S7 now runs it in 227 msec. Strangely however Guile 1.8 can run a typical menu-expand invocation in 3 msec while S7 now runs it in 94 msec, so there seems to be still a gap somewhere. 

It is a pity however that I have to pollute the rootlet with all my symbols. I would have liked to keep them in a sublet. Is there any way one can introduce some caching to improve symbol lookup in function application?


> On 2. Jan 2021, at 00:57, bil at ccrma.stanford.edu <bil at ccrma.Stanford.EDU> wrote:
>> (define fib (lambda args #f))
>> (set! fib (lambda (n) (if (< n 2) n (+ (fib (- n 1)) (fib (- n 2))))))
> argh -- that tickles a bug in s7 -- change it to
> (define fib (lambda (n) #f)) then the set!, and s7
> stupidly uses the old version of fib in the lambda body!
> I can't believe I never noticed this.  Thanks!

More information about the Cmdist mailing list