lkml.org 
[lkml]   [2021]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] lib/string: Bring optimized memcmp from glibc
From
Date


On 21.07.21 г. 21:45, Linus Torvalds wrote:
> On Wed, Jul 21, 2021 at 11:17 AM Nikolay Borisov <nborisov@suse.com> wrote:
>>
>> I find it somewhat arbitrary that we choose to align the 2nd pointer and
>> not the first.
>
> Yeah, that's a bit odd, but I don't think it matters.
>
> The hope is obviously that they are mutually aligned, and in that case
> it doesn't matter which one you aim to align.
>
>> So you are saying that the current memcmp could indeed use improvement
>> but you don't want it to be based on the glibc's code due to the ugly
>> misalignment handling?
>
> Yeah. I suspect that this (very simple) patch gives you the same
> performance improvement that the glibc code does.

You suspect correctly, perf profile:

30.44% -29.38% [kernel.vmlinux] [k] memcmp

This is only on x86-64 as I don't have other arch handy. But this one is
definitely good.


\
 
 \ /
  Last update: 2021-07-22 19:14    [W:0.082 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site