[PATCH] Remove small copy optimization from xsputn
Carlos O'Donell
carlos@systemhalted.org
Thu Mar 29 21:59:00 GMT 2012
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.
More information about the Libc-alpha
mailing list