[asdf-devel] optimization settings

Stelian Ionescu sionescu at cddr.org
Thu Mar 20 15:39:42 UTC 2014


On Wed, 2014-03-19 at 17:22 -0500, Robert Goldman wrote:
> Robert Brown wrote:
> > Does ASDF set compiler optimization settings before compiling
> > each file when building?  I'm concerned that changing the
> > optimization setting inside one source file could cause the
> > change to stick and be used for other files.  I don't think the
> > CL standard mandates that "(declaim (optimize ... ))" applies
> > only to the current file.
> >
> > The issue is similar to that of readtables ...
> 
> To the best of my knowledge (i.e., I'm not looking it up again right now!) you are right that the standard does not mandate file-scope for DECLAIM, and I have a *vague* memory that some implementation does allow it to leak. 
> 
> I am reluctant to add this to the set of things that ASDF (mis)manages for the programmer.  E.g, I think SBCL has a "policy" setting that is intended to provide a default setting for the optimization parameters.
> 
> However, you COULD do this yourself, I believe, by writing an :AROUND method for PERFORM COMPILE-OP on your own system.  I'm actually not sure what the right mechanism is.  Would it be:
> 
> (defmethod perform :around ((op compile-op) (c my-optimized-files))
>   (locally (declare (optimize (speed 3) (good-looking 11)))
>     (call-next-method)))

LOCALLY has lexical scope.

-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/asdf-devel/attachments/20140320/fc96f416/attachment.sig>


More information about the asdf-devel mailing list