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.