all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: Jim Meyering <jim@meyering.net>
Cc: Emacs development discussions <emacs-devel@gnu.org>,
	"Kim F. Storm" <storm@cua.dk>
Subject: Re: Remove useless if-before-free and if-before-xfree tests
Date: Tue, 30 Jun 2009 08:43:58 +0900	[thread overview]
Message-ID: <871vp2y5a9.fsf@uwakimon.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <87fxdjtqfo.fsf@meyering.net>

Jim Meyering writes:
 > Kim F. Storm wrote:
 > > Jim Meyering <jim@meyering.net> writes:
 > >> I removed a bunch of these last year.
 > >> Since then, a few have snuck back in, so here's another round.
 > >> I've just committed the following two change sets:
 > >
 > > I haven't looked specifically at the changes, but a test before xfree
 > > may not be useless performance-wise if the normal case is "ptr is NULL".

These "normally NULL" cases are likely only in "last chance" cleanup,
which should be outside the loop.

 > Hi Kim,
 > 
 > If adding that extra "if" test-before-free leads to a measurable
 > performance improvement, please let me know.  I've removed hundreds
 > of such tests in many projects, and so far no one has taken the time
 > (or been able?) to demonstrate such a thing.
 > 
 > Besides, even if there is a measurable performance difference, in my book,
 > the cleaner code trumps what can only be a negligible performance hit.

"inline" is your friend.  If you don't trust GCC (and on this kind of
thing, who does? :-), you can force xfree to inline the test by
defining it as a macro.




      reply	other threads:[~2009-06-29 23:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-29  5:30 Remove useless if-before-free and if-before-xfree tests Jim Meyering
2009-06-29  7:52 ` Kim F. Storm
2009-06-29  8:06   ` Jim Meyering
2009-06-29 23:43     ` Stephen J. Turnbull [this message]

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=871vp2y5a9.fsf@uwakimon.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=emacs-devel@gnu.org \
    --cc=jim@meyering.net \
    --cc=storm@cua.dk \
    /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.