From: "Juanma Barranquero" <lekktu@gmail.com>
To: "David Kastrup" <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: "simplifications"
Date: Mon, 19 Nov 2007 11:56:35 +0100 [thread overview]
Message-ID: <f7ccd24b0711190256p7b6c62e4m4d86edaeb38b749e@mail.gmail.com> (raw)
In-Reply-To: <86ejem1pig.fsf@lola.quinscape.zz>
On Nov 19, 2007 11:46 AM, David Kastrup <dak@gnu.org> wrote:
> Could people, before introducing such "optimizations", check the
> bytecode?
Some functions of ring.el already used c??r before my change. etc.
> The former is _quite_ less efficient, so it is not a hot idea to use
> it for data access primitives like the ring functions.
Out of idle curiosity, I'd be really interested in knowing about uses
of ring.el where that difference is going to be significant (i.e.,
we're speaking perhaps of thousands of ring function calls per
second?).
> Personally, I think that we should make the byte compiler optimize the
> unnecessary binding away. But until that is the case, please don't
> gratuitously replace (car (cdr ...)) with (cadr ...).
I don't usually do it gratuitously, or I would've done it in a lot of
places. I stumbled upon it, and certainly having code chock-full of
(let ((hd (car (car ...)))
(ln (car ...))
(vec (cdr (cdr ...))))
is not my idea of fun, or legible, or maintainable, or... you pick the
word. Not that c??r is much of an improvement; we should be able to
define accesor functions in the package
(defsubst ring--vec (ring)
(cdr (cdr ring)))
and have the byte-compiler optimize them away.
So, IMO, instead of bringing back the pain, let's enhance the byte-optimizer.
But of course, you can revert the change if you dislike it that much.
Juanma
next prev parent reply other threads:[~2007-11-19 10:56 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-19 10:46 "simplifications" David Kastrup
2007-11-19 10:56 ` Juanma Barranquero [this message]
2007-11-19 15:11 ` "simplifications" Stefan Monnier
2007-11-19 15:19 ` "simplifications" David Kastrup
2007-11-19 15:39 ` "simplifications" Juanma Barranquero
2007-11-19 15:44 ` "simplifications" Stefan Monnier
2007-11-19 15:47 ` "simplifications" Juanma Barranquero
2007-11-19 15:58 ` "simplifications" Stefan Monnier
2007-11-19 16:08 ` "simplifications" Juanma Barranquero
2007-11-19 18:46 ` "simplifications" Stefan Monnier
2007-11-19 16:02 ` "simplifications" David Kastrup
2007-11-19 16:05 ` "simplifications" Juanma Barranquero
2007-11-20 3:59 ` "simplifications" Richard Stallman
2007-11-20 15:27 ` "simplifications" Stefan Monnier
2007-11-21 21:37 ` "simplifications" Stephen J. Turnbull
2007-11-21 21:52 ` "simplifications" David Kastrup
2007-11-22 1:34 ` "simplifications" Stephen J. Turnbull
2007-11-19 11:02 ` "simplifications" Juanma Barranquero
2007-11-19 11:33 ` "simplifications" Miles Bader
2007-11-19 11:57 ` "simplifications" David Kastrup
2007-11-19 12:08 ` "simplifications" Juanma Barranquero
2007-11-19 12:21 ` "simplifications" David Kastrup
2007-11-19 12:32 ` "simplifications" Juanma Barranquero
2007-11-19 12:49 ` "simplifications" David Kastrup
2007-11-19 12:54 ` "simplifications" Juanma Barranquero
2007-11-20 3:59 ` "simplifications" Richard Stallman
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=f7ccd24b0711190256p7b6c62e4m4d86edaeb38b749e@mail.gmail.com \
--to=lekktu@gmail.com \
--cc=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).