Re: [PATCH] lib: string.c: A speed optimized for strncpy

2014-10-15 Thread Dan Carpenter
On Sun, Oct 05, 2014 at 06:01:43PM +0200, Rickard Strandqvist wrote: > Hi > > Yes, it can be faster, even if it is as you say, probably a difference > depending on the size of the count. > And even greater need to test this on a variety of hardware :-/ Most architectures (the notable exception is

Re: [PATCH] lib: string.c: A speed optimized for strncpy

2014-10-05 Thread Rickard Strandqvist
Hi Yes, it can be faster, even if it is as you say, probably a difference depending on the size of the count. And even greater need to test this on a variety of hardware :-/ But I try to do my test with the memset variant to. Kind regards Rickard Strandqvist 2014-10-05 17:36 GMT+02:00 Joe Perc

Re: [PATCH] lib: string.c: A speed optimized for strncpy

2014-10-05 Thread Joe Perches
On Sun, 2014-10-05 at 15:29 +0200, Rickard Strandqvist wrote: > This variant is in my tests about 7-10% faster, and also think > it is perhaps even clearer code than before. [] > diff --git a/lib/string.c b/lib/string.c [] > @@ -123,12 +123,12 @@ char *strncpy(char *dest, const char *src, size_t co

[PATCH] lib: string.c: A speed optimized for strncpy

2014-10-05 Thread Rickard Strandqvist
This variant is in my tests about 7-10% faster, and I also think it is perhaps even clearer code than before. I assume that more will do the testing, I do not know if we should do tests on different types of hardware as well, my test was on a new Intel I7. Rickard Strandqvist (1): lib: string.c

[PATCH] lib: string.c: A speed optimized for strncpy

2014-10-05 Thread Rickard Strandqvist
This variant is in my tests about 7-10% faster, and also think it is perhaps even clearer code than before. Signed-off-by: Rickard Strandqvist --- lib/string.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/string.c b/lib/string.c index f3c6ff5..6961229 10