From: Andi Kleen <andi@firstfloor.org>
To: Soumyadip Das Mahapatra <dip_kernel@yahoo.co.in>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Improved Swaping Method In sort.c
Date: Wed, 30 Apr 2008 20:17:22 +0200 [thread overview]
Message-ID: <87fxt3gqbx.fsf@basil.nowhere.org> (raw)
In-Reply-To: <191572.86791.qm@web94110.mail.in2.yahoo.com> (Soumyadip Das Mahapatra's message of "Wed, 30 Apr 2008 23:39:09 +0530 (IST)")
Soumyadip Das Mahapatra <dip_kernel@yahoo.co.in> writes:
> But this code saves memory equaling two integers. What about that ?
It won't because the compiler uses registers not memory for the
temporary of course. In fact your version will cause more memory
accesses because the compiler doesn't know that a and b do not alias
each other, so it cannot cache the immediate value and has to always
go through memory. The difference will not be large on x86 because L1
cache accesses are reasonably fast, but they're still much slower than
a register access.
-Andi
next prev parent reply other threads:[~2008-04-30 18:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-30 18:09 Soumyadip Das Mahapatra
2008-04-30 18:17 ` Andi Kleen [this message]
2008-04-30 18:19 ` Ray Lee
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=87fxt3gqbx.fsf@basil.nowhere.org \
--to=andi@firstfloor.org \
--cc=dip_kernel@yahoo.co.in \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®