[Ecls-list] SETF functions speedup
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Wed Dec 14 08:31:02 UTC 2011
I just committed a set of changes that simplify the way ECL handles SETF
definitions, including both the macroexpanders and the SETF functions. In
the last case ECL uses an optimization present also in SBCL, which is to
store the location of the SETF function slot in the compiled code, avoiding
repeated calls to FDEFINITION.
This provides some speedup in code that is intensive on SETF functions,
such as code using CLOS. In the PRINT/PRETTY benchmark, for instance, this
gives about 10% speedup on my tiny laptop.
The whole code also cleans up a little bit the existing mess of SETF forms,
which included structure accessors, long and short DEFSETF forms and
DEFINE-SETF-METHOD forms, each of which was using a different way of
storing its macroexpanders.
It also introduces a tiny optimization which allows ECL to remove the
enclosing LET/MULTIPLE-VALUE-BIND when expanding a SETF form. The basic
idea s that when a SETF expansion consists of a function name, the same
list of arguments and the value, that is
(SETF (FOO a1 ... aN) X) -> (FAA a1 ... aN X)
then ECL recognizes that there is no need to create any temporaries. I
think I got this right, didn't I?
Please report any problem.
Juanjo
--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20111214/74c1437a/attachment.html>
More information about the ecl-devel
mailing list