All of lore.kernel.org
 help / color / mirror / Atom feed
From: Folkert van Heusden <folkert@vanheusden.com>
To: Mitchell Blank Jr <mitch@sfgoth.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: optimalisation for strlcpy (lib/string.c)
Date: Sun, 10 Dec 2006 22:41:09 +0100	[thread overview]
Message-ID: <20061210214108.GF30197@vanheusden.com> (raw)
In-Reply-To: <20061210215504.GD47959@gaz.sfgoth.com>

> > Like the other patch (by that other person), I think it is faster to not
> > do a strlen first.
> Debatable.  You've replaced a call to the highly-optimized memcpy function
> with a byte-by-byte copy.  It's probably a wash performance wise (have you
> benchmarked?) and is certainly less clear.

I tested it outside the kernel.
The test source can be found here:
http://www.vanheusden.com/misc/kernel-strlcpy-opt-test.c


Folkert van Heusden

-- 
Feeling generous? -> http://www.vanheusden.com/wishlist.php
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com

  reply	other threads:[~2006-12-10 21:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-10 21:23 optimalisation for strlcpy (lib/string.c) Folkert van Heusden
2006-12-10 21:49 ` Eyal Lebedinsky
2006-12-10 22:03   ` Folkert van Heusden
2006-12-10 21:55 ` Mitchell Blank Jr
2006-12-10 21:41   ` Folkert van Heusden [this message]
2006-12-10 23:13 ` Adrian Bunk
2006-12-11  5:26   ` Clemens Koller

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=20061210214108.GF30197@vanheusden.com \
    --to=folkert@vanheusden.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitch@sfgoth.com \
    /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.