On Tue, Jun 30, 2009 at 8:02 PM, Gabriel Dos
> OK. Le me say more about uses of Lisp in OpenAxiom.
> There are heavy uses of generic sequence functions (map, elt, etc.)
This can severely improve in several ways:
0) Improve the sequence functions.
1) Write compiler macros that expand the sequence functions, allowing
the possibility to open-code them. We have some of that for MAP, but
others can be done.
2) Add additional inline forms for some of those functions given the
types of the arguments. The list of inline forms for ELT and others is
currently very limited. See:
(def-inline elt :always (t t) t "ecl_elt(#0,fixint(#1))")
(def-inline elt :always (t fixnum) t "ecl_elt(#0,#1)")
(def-inline elt :unsafe (t t) t "ecl_elt(#0,fix(#1))")
(def-inline elt :unsafe (t fixnum) t "ecl_elt(#0,#1)")
One could add others that mimic what is done with arrays:
(def-inline elt :unsafe ((array t (*)) fixnum) t "...")
This does not really involve learning about the compiler but requires
knowing a bit about the C interface.
> In summary, we use only a tiny subset of
> CL, and that small core is primarily used as a virtual machine.
> You would be surprised to see however primitive the generated Lisp
> looks like :-) Ah, we CONS a lot.
This can also be improved. Allocation currently is a problem because
it has to be done in an interrupt-safe way. This, and the fact that we
do not use the inline forms of the garbage collector, has made things
like CONS a bit slower than I would like.
> I'm not claiming that use is typical of performance problems in ECL. I'm
> just offering data points (e.g. not artificially made up.)
It is a pity that OpenAxiom is such a complex beast that I would not
know where to begin for profiling it.
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)