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? Best Max > On 2. Jan 2021, at 00:57, [email protected] <[email protected]> > 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! > _______________________________________________ Cmdist mailing list [email protected] https://cm-mail.stanford.edu/mailman/listinfo/cmdist
