git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stephen R. van den Berg" <srb@cuci.nl>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Thomas Spura <tomspur@fedoraproject.org>, git@vger.kernel.org
Subject: Re: [PATCH] speed: reuse char instead of recreation in loop
Date: Tue, 26 May 2009 13:54:03 +0200	[thread overview]
Message-ID: <20090526115403.GA4246@cuci.nl> (raw)
In-Reply-To: <alpine.LNX.2.00.0905251733240.2147@iabervon.org>

Daniel Barkalow wrote:
>On Mon, 25 May 2009, Thomas Spura wrote:
>> Am Mon, 25 May 2009 22:16:02 +0200 schrieb Bj?rn Steinbrink:
>> > On 2009.05.25 19:44:10 +0000, Thomas Spura wrote:
>> >> Move a char and a char * outside of a for loop for speed improvements

>> > I doubt that this makes any difference at all.

>> With ints, the loop costs about 40% of speed. Without recreation, it 
>> should be always faster.

>optimizations in this code for it to make, but, in general, letting 
>variables in loops go out of scope (in C) only improves optimization 
>possibilities.

Quite.  The proposed patch is more likely to slow down the code than to
speed it up.
-- 
Sincerely,
           Stephen R. van den Berg.

E Pluribus Unix.

  reply	other threads:[~2009-05-26 11:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-25 19:44 [PATCH] speed: reuse char instead of recreation in loop Thomas Spura
2009-05-25 20:16 ` Björn Steinbrink
2009-05-25 20:40   ` Thomas Spura
2009-05-25 22:08     ` Daniel Barkalow
2009-05-26 11:54       ` Stephen R. van den Berg [this message]
2009-05-25 20:39 ` René Scharfe
2009-05-25 20:44   ` Thomas Spura

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=20090526115403.GA4246@cuci.nl \
    --to=srb@cuci.nl \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=tomspur@fedoraproject.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.
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 NNTP newsgroup(s).