[CM] Performance of S7

Massimiliano Gubinelli m.gubinelli at gmail.com
Mon Jan 4 10:44:51 PST 2021

Hi all,

 I would like to give an update on the work of porting TeXmacs to S7. Currently it seems to work well and I'm not aware of serious bugs, but I've still to reorganise the changes and test it more. You can find it here:

https://github.com/mgubi/texmacs/tree/s7/src <https://github.com/mgubi/texmacs/tree/s7/src>

in the README.md file you find also some results of running some r7rs benchmarks against S7 and Guile 1.8, Guile 3.0.4. Based on them I still expect to be able to have better performance of TeXmacs/S7 vs. TeXmacs/Guile1.8. Currenlty the startup time is 4x faster, but compiling the full user manual (~120 pages) takes 20 sec for S7 and 15 sec for Guile 1.8. 


> On 2. Jan 2021, at 17:13, Massimiliano Gubinelli <m.gubinelli at gmail.com> wrote:
> 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, 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!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20210104/2ae6293d/attachment.html>

More information about the Cmdist mailing list