[CM] TeXmacs & S7

bil at ccrma.Stanford.EDU bil at ccrma.Stanford.EDU
Mon Jan 17 12:13:10 PST 2022


Thanks for the observations -- I'm glad s7 has
worked out reasonably well.  On your questions:


1) would it be possible to have lookup_from implemented via some hash 
table...?
    Alternatively, can our patch be made into the official version?

Currently, s7's optimizer sometimes depends on the position of the 
variables
in environments, so your change is only safe if the optimizer gives up.
Since the order matters, a hash-table lookup is unlikely to work without
some serious overhead.  Most environments have only a handful of locals, 
and
a small linear search is faster than a hash-table lookup (and the search 
is
unnecessary if the variables have unique names).

I think your situation is an unusual case: you apparently have more than
100 local variables in an environment, and the ones you want do not have
unique names.  I wonder if you could use a hash-table for the local 
variables.
Or (kinda ugly) look at the code and place the most used variables so
they are at the front of the list of slots (I can't immediately remember
whether that means first or last in the list of let variables).


2) Suggestions to explain the high memory usage?

(*s7* 'memory-usage) can tell you what is taking up the space.
If that doesn't help, you might be able to tune the GC with
the gc-related fields in *s7*.




More information about the Cmdist mailing list