emacs-devel
[Top][All Lists]
Advanced

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

Re: Byte compiler inefficiency


From: David Kastrup
Subject: Re: Byte compiler inefficiency
Date: Tue, 09 Aug 2005 09:06:19 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"Richard M. Stallman" <address@hidden> writes:

>     > When cadr is called interpretively, the binding of x is like
>     > any other binding.
>
>     Sure, but the binding can't possible have any effect on the
>     result.
>
> In the particular case of cadr, it can't, because no non-primitive
> functions are called.  If the compiler could detect this kind of
> case, it could do the optimization safely.
>
> However, if the defsubst calls some non-primitives, they could refer
> to the variable, so failing to bind it would be unsafe.

Probably it would make sense to put a property on functions that are
known not to depend on external bindings.  The byte compiler could
even propagate this property to functions like cadr.

> Implementing the optimization in the former case would be useful,
> and I will put it in etc/TODO, but it should not be done until after
> the release.

Thanks.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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