mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: akpm@osdl.org, laforge@netfilter.org, jmorris@intercode.com.au,
	coreteam@netfilter.org, linux-kernel@vger.kernel.org,
	jesper.juhl@gmail.com
Subject: Re: [PATCH] Decrease number of pointer derefs in nfnetlink_queue.c
Date: Thu, 08 Dec 2005 18:56:25 -0500	[thread overview]
Message-ID: <1134086185.6279.47.camel@localhost.localdomain> (raw)
In-Reply-To: <20051208.145148.36886043.davem@davemloft.net>

On Thu, 2005-12-08 at 14:51 -0800, David S. Miller wrote:
> From: Jesper Juhl <jesper.juhl@gmail.com>
> Date: Thu, 8 Dec 2005 23:36:01 +0100
> 
> > Here's a small patch to decrease the number of pointer derefs in
> > net/netfilter/nfnetlink_queue.c
> > 
> > Benefits of the patch:
> >  - Fewer pointer dereferences should make the code slightly faster.
> >  - Size of generated code is smaller
> >  - improved readability
> 
> And you verified the compiler isn't making these transformations
> already?  It should be doing so via Common Subexpression Elimination
> unless the derefs are scattered around with interspersed function
> calls in which case the compiler cannot prove that the memory
> behind the pointer does not change.

Even if point one and two are not true, if it doesn't hurt size or
performance, point three (improved readability) is definitely worth
adding.

-- Steve



  parent reply	other threads:[~2005-12-08 23:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-08 22:36 Jesper Juhl
2005-12-08 22:51 ` David S. Miller
2005-12-08 23:10   ` Jesper Juhl
2005-12-08 23:56   ` Steven Rostedt [this message]
2005-12-09  0:08   ` Jeff Garzik
2005-12-09  5:04 ` Harald Welte

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=1134086185.6279.47.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=akpm@osdl.org \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=jesper.juhl@gmail.com \
    --cc=jmorris@intercode.com.au \
    --cc=laforge@netfilter.org \
    --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

Powered by JetHome