all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: Adding many elements to a list
Date: Tue, 22 Sep 2009 14:37:15 +0200	[thread overview]
Message-ID: <7cskefp344.fsf@pbourguignon.lefevre.anevia.com> (raw)
In-Reply-To: 87vdjbrx7n.fsf@lola.goethe.zz

David Kastrup <dak@gnu.org> writes:
> Well, consult its doc string for what it does and doesn't.  It's
> basically the same issue as with setf/setq: the cl version of push does
> a number of different things depending on a vague concept "location".
> But you almost never need this sort of flexibility at runtime, and at
> compile time, it obfuscates what actually happens, including the
> possible performance impacts.

You should write in assembler (what do I say, in binary!), because you
almost never need the flexibility that the bare push provide at
run-time, and at compilation time, it obfuscate what really happens,
including the possible performance impacts.

(disassemble (byte-compile (lambda (x) (push x *a*))))
-->
byte code:
  args: (x)
0       varref    x
1       varref    *a*
2       cons      
3       dup       
4       varset    *a*
5       return    

See?  There's a dup that's most often not used.  Performance IMPACT!

-- 
__Pascal Bourguignon__


  reply	other threads:[~2009-09-22 12:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-18 13:15 Adding many elements to a list Nordlöw
2009-09-18 13:44 ` Pascal J. Bourguignon
2009-09-18 14:23   ` David Kastrup
2009-09-18 14:48     ` Pascal J. Bourguignon
2009-09-18 14:54       ` David Kastrup
2009-09-18 15:13         ` Pascal J. Bourguignon
2009-09-19  7:34           ` Andreas Politz
2009-09-22  7:07           ` David Kastrup
2009-09-22 11:53             ` Pascal J. Bourguignon
2009-09-22 12:16               ` David Kastrup
2009-09-22 12:37                 ` Pascal J. Bourguignon [this message]
2009-09-22 15:18                   ` David Kastrup
2009-09-28 20:03                 ` Samuel Wales
2009-09-18 16:24         ` Thierry Volpiatto
2009-09-18 13:52 ` David Kastrup

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

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

  git send-email \
    --in-reply-to=7cskefp344.fsf@pbourguignon.lefevre.anevia.com \
    --to=pjb@informatimago.com \
    --cc=help-gnu-emacs@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.