[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] use unlocked io in getdelim
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH] use unlocked io in getdelim |
Date: |
Wed, 27 Aug 2008 14:39:00 +0200 |
User-agent: |
Thunderbird 2.0.0.16 (Macintosh/20080707) |
Eric Blake wrote:
> According to Paolo Bonzini on 8/27/2008 5:48 AM:
>> Under MacOS, getc is not a macro, only getc_unlocked is. This patch
>> does two things: 1) it makes getdelim use getc_unlocked if it can wrap
>> the calls with flockfile/funlockfile; 2) it makes getdelim omit the
>> locking altogether if unlocked-io is in effect. It speeds up sed by
>> almost 2x in very simple scripts with very little regular expression
>> matching (such as '/^something/!d').
>
>> Ok?
>
> Sounds interesting. How does this compare with the current approach used
> by getndelim2, which uses freadptr to avoid getc?
I don't know. :-) It could be even faster to use freadptr and memchr
indeed. But getline is now completely off the profile for sed.
Paolo
- [PATCH] use unlocked io in getdelim, Paolo Bonzini, 2008/08/27
- Re: [PATCH] use unlocked io in getdelim, Eric Blake, 2008/08/27
- Re: [PATCH] use unlocked io in getdelim,
Paolo Bonzini <=
- Re: [PATCH] use unlocked io in getdelim, Paolo Bonzini, 2008/08/27
- Re: [PATCH] use unlocked io in getdelim, Paolo Bonzini, 2008/08/27
- Re: [PATCH] use unlocked io in getdelim, Eric Blake, 2008/08/27
- Re: [PATCH] use unlocked io in getdelim, Paolo Bonzini, 2008/08/27
- Re: [PATCH] use unlocked io in getdelim, Jim Meyering, 2008/08/28
- Re: getndelim2 license, Bruno Haible, 2008/08/28
- Re: getndelim2 license, Paolo Bonzini, 2008/08/29
- Re: getndelim2 license, Jim Meyering, 2008/08/29
- Re: [PATCH] use unlocked io in getdelim, Simon Josefsson, 2008/08/27
- Re: [PATCH] use unlocked io in getdelim, Paolo Bonzini, 2008/08/27