This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Remove small copy optimization from xsputn


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]