On Thu, Mar 04, 2021 at 05:02:41PM +0100, Ralf Hemmecke wrote:
> >> Third, is it a bug that compile TMFORM requires so much RAM?
> >> We should look into it to see if RAM usage can be reduced.
> >
> > AFAICS RAM usage during compilation of TMFORM is really sbcl
> > bug. It seem that the problem is the same as AWAIC.
> > Namely, we need to initialise a table and at Lisp level
> > it is longish segment of code with calls but no jump.
>
> Are we talking about TexmacsFormat?
>
> The only long list is for CorkFunc. But that is a list of records. What
> can be difficult for that to be compiled in Lisp?
Just one explanation: Spad data is mutable. Lisp constant
data is immutable, so Spad _have to_ translate list for CorkFunc
as a sequence of calls to 'construct'. This is 794 calls,
not very large number and _should_ not be problem for Lisp
compiler. But apparently it is. AWAIC produces more than
3000 calls and calls are more complicated than in TMFORM.
Still, with capacities of modern machine there should be
no problem. But sbcl behaviour in AWAIC is really much
worse then on TMFORM...
> Maybe it helps to list
> the data as a list of lists and do the construction a bit differently.
AFAICS there is no reasonable workaround at Spad level (I do not
consider splitting table between several packages as reasonable).
I principle Spad compiler could recognize initialization pattern,
produce list which is Lisp constant (so Lisp compiler presumably
would handle it resonably) and then use iteration over constant
list to initialize Spad list. But that would be rather significant
addition to Spad compiler.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/20210305132521.GA11837%40math.uni.wroc.pl.