unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Byte compiler inefficiency
Date: Tue, 09 Aug 2005 09:06:19 +0200	[thread overview]
Message-ID: <85ll3by4gk.fsf@lola.goethe.zz> (raw)
In-Reply-To: <E1E2K5k-0008U9-5f@fencepost.gnu.org> (Richard M. Stallman's message of "Mon, 08 Aug 2005 22:43:48 -0400")

"Richard M. Stallman" <rms@gnu.org> 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	other threads:[~2005-08-09  7:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-07 11:34 Byte compiler inefficiency David Kastrup
2005-08-08 12:09 ` Richard M. Stallman
2005-08-08 12:20   ` David Kastrup
2005-08-09  2:43     ` Richard M. Stallman
2005-08-09  7:06       ` David Kastrup [this message]
2005-08-10  0:16 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85ll3by4gk.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).