This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Remove small copy optimization from xsputn
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: David Miller <davem at davemloft dot net>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 29 Mar 2012 17:58:56 -0400
- Subject: Re: [PATCH] Remove small copy optimization from xsputn
- References: <20120329.005206.1690637678057774380.davem@davemloft.net>
On Thu, Mar 29, 2012 at 12:52 AM, David Miller <davem@davemloft.net> wrote:
>
> Let the compiler and/or the optimized mempcpy implementation take care
> of this.
>
> The hand-written byte-at-a-time loop for counts <= 20 actually showed
> up in profiles for me.
>
> This slow loop triggers for a reasonably important case, since PADSIZE
> is 16.
>
> Any objections?
>
> 2012-03-28 ?David S. Miller ?<davem@davemloft.net>
>
> ? ? ? ?* libio/fileops.c (_IO_new_file_xsputn): Don't try to optimize
> ? ? ? ?small copies by hand.
No objection here.
You've made the function readable, faster, and removed a magic
constant of "20" :-)
Cheers,
Carlos.