All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: daniel.marjamaki@gmail.com
Cc: netdev@vger.kernel.org, kernel-janitors@lists.osdl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [KJ] [PATCH] net/core/flow.c: compare data with memcmp
Date: Tue, 02 Jan 2007 23:36:26 +0000	[thread overview]
Message-ID: <20070102.153626.14976011.davem@davemloft.net> (raw)
In-Reply-To: <80ec54e90701010116u27d02341kb2be785f17f18e3d@mail.gmail.com>

From: "Daniel_Marjamäki" <daniel.marjamaki@gmail.com>
Date: Mon, 1 Jan 2007 10:16:02 +0100

> I have done a little testing on my own. My results is that memcpy is
> many times faster even with aligned data.

Your test program doesn't make any measurements, from where did
you get these "results"?

Also, your test program is broken because in the memcmp() case GCC
totally optimizes away the call to memcmp() because it can see the
comparison data at compile time and therefore it computes the memcmp()
result at compile time.  There are no memcmp() calls made at all by
your program.

You should look at the assembler code emitted by a test program
that is measuring performance, in detail, to make sure the test
program really is doing what you think it is.

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

WARNING: multiple messages have this Message-ID (diff)
From: David Miller <davem@davemloft.net>
To: daniel.marjamaki@gmail.com
Cc: netdev@vger.kernel.org, kernel-janitors@lists.osdl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/core/flow.c: compare data with memcmp
Date: Tue, 02 Jan 2007 15:36:26 -0800 (PST)	[thread overview]
Message-ID: <20070102.153626.14976011.davem@davemloft.net> (raw)
In-Reply-To: <80ec54e90701010116u27d02341kb2be785f17f18e3d@mail.gmail.com>

From: "Daniel_Marjamäki" <daniel.marjamaki@gmail.com>
Date: Mon, 1 Jan 2007 10:16:02 +0100

> I have done a little testing on my own. My results is that memcpy is
> many times faster even with aligned data.

Your test program doesn't make any measurements, from where did
you get these "results"?

Also, your test program is broken because in the memcmp() case GCC
totally optimizes away the call to memcmp() because it can see the
comparison data at compile time and therefore it computes the memcmp()
result at compile time.  There are no memcmp() calls made at all by
your program.

You should look at the assembler code emitted by a test program
that is measuring performance, in detail, to make sure the test
program really is doing what you think it is.

  reply	other threads:[~2007-01-02 23:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-31 16:37 [KJ] [PATCH] net/core/flow.c: compare data with memcmp Daniel Marjamäki
2006-12-31 16:37 ` Daniel Marjamäki
2006-12-31 19:49 ` [KJ] " Nishanth Aravamudan
2006-12-31 19:49   ` Nishanth Aravamudan
2006-12-31 20:37 ` David Miller
2006-12-31 20:37   ` David Miller
2007-01-01  7:47   ` [KJ] " Daniel Marjamäki
2007-01-01  7:47     ` Daniel Marjamäki
2007-01-01  8:49     ` [KJ] " David Miller
2007-01-01  8:49       ` David Miller
2007-01-01  9:16     ` [KJ] " Daniel Marjamäki
2007-01-01  9:16       ` Daniel Marjamäki
2007-01-02 23:36       ` David Miller [this message]
2007-01-02 23:36         ` David Miller

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=20070102.153626.14976011.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=daniel.marjamaki@gmail.com \
    --cc=kernel-janitors@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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 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.