[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getline vs linebuffer
From: |
Pádraig Brady |
Subject: |
Re: getline vs linebuffer |
Date: |
Tue, 27 Sep 2011 23:25:54 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 |
On 09/27/2011 11:12 PM, Reuben Thomas wrote:
> On 27 September 2011 22:45, Reuben Thomas <address@hidden> wrote:
>> On 26 September 2011 23:24, Eric Blake <address@hidden> wrote:
>>>
>>> So _both_ linebuffer and getdelim would benefit from a conversion to
>>> freadptr.
>>
>> I just tried using getndelim2 instead of getline for a program which
>> slurps text line by line but spends most of its time regexp-searching
>> the text, and it made no detectable difference, so I guess it really
>> does have to be hardcore slurping.
>
> Or perhaps glibc's getline is efficient?
I found it very efficient
http://www.pixelbeat.org/programming/readline/
Note when testing io functions ensure that gnulib/lib/unlocked-io.h
is used appropriately, especially for getc using functions like getndelim2()
I previously did an itemization of the line processing in coreutils:
http://lists.gnu.org/archive/html/bug-coreutils/2009-03/msg00116.html
cheers,
Pádraig.
Re: getline vs linebuffer, Bruno Haible, 2011/09/26