uclibc getline is much slower than glibc

Khem Raj raj.khem at gmail.com
Wed Jun 22 14:49:30 UTC 2011


On 06/22/2011 07:11 AM, Ed W wrote:
> On 20/06/2011 22:34, Khem Raj wrote:
>> Looking at getdelim implementation of both I see that uclibc
>> uses a simple loop over characters in stream but glibc uses
>> memcpy and copies the characters in chunks. So essentially
>> it seems that with change to use readline the code remained
>> almost same for uclibc(execution wise) and hence the time should
>> remain same too as its seen in your runs with uclibc time does not change much
>
> Hi, This speed effect was most noticable to me in calling modprobe which
> read in a mere 100KB file, but was taking>  1/20th of a second to do
> so... (Do it a few times and you have a lot of wait time)  In the case
> of busybox the same line reading code also affects interesting utilities
> such as sed. Probably other code trying to read largish files would also
> benefit from speedups to this code?
>
> What would be the objections to switching to a glibc style
> implementation with memcpy? It seems like a reasonably easy function to
> show it's somewhat performance hindered - is any additional code/memory
> usage reasonable for the performance increase? Any reason why we can't
> simply swipe the glibc implementation?
>
sure we can. Send patches, I would also be interested to see the code 
increase it will cause and if there is anything we can do about that


> Thanks
>
> Ed W
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc



More information about the uClibc mailing list