help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When to choose defsubst


From: Stefan Monnier
Subject: Re: When to choose defsubst
Date: Mon, 02 Apr 2007 13:31:23 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux)

> I tried to find an easy answer but failed miserably at it :/
> So my question is this: when/why should I use a defsubst ?

Never.


        Stefan


PS: `defsubst' is like `defun' except it additionally tells the
    byte-compiler that this function should be inlined at every call site.
    In some rare cases, it can make a noticeable performance difference,
    but these are very rare, so you should only do that after noticing an
    actual performance problem and finding out where time is spent (with
    elp, typically).
    The reason not to use `defsubst' is that it does not behave well w.r.t
    debug/advice/trace/...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]