I still suggest that you put this definition in one of the required files
for the compilation of maxima:
(defmacro memq(a b) `(member ,a ,b :test #'eq))
and not edit files that contain memq.
I looked through simp.lisp, and if you want to make the expansion into (or
(eq ...) (...))
for constant second arguments to memq, that would cover about half the
cases, I think, and be much faster.
For most of the others, like (memq 'simp s)
the usual case is that s is either a list like (mplus) or (mplus simp) or
possibly 3 elements. So memq is run on very short lists.
so we could expand (memq a b) to be
(or (and b (eq a (car b))
(and (cdr b)(eq a (cadr b))
(and (cddr b)(eq a (caddr b)))
(member a (cdddr b) :test #'eq))
RJF
PS, I do not endorse this kind of hacking in general, as a way of improving
code.
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Barton Willis
> Sent: Sunday, April 06, 2008 4:05 AM
> To: Andreas Eder
> Cc: Maxima List; Raymond Toy
> Subject: Re: [Maxima] [Maxima-commits] CVS: maxima/src
> simp.lisp,1.55,1.56
>
> -----maxima-bounces at math.utexas.edu wrote: -----
>
> > Well, depending on the lisp implementation replacing memq gives me
> > between 7% and 10% speedup when running the test-suite. I think
> > this isn't so little.
>
> Now that I understand that memq --> member speeds the test suite by
> 7% or more, I'm all for making the change. Thanks for the explanation.
>
> Barton
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>