bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] use unlocked io in getdelim


From: Eric Blake
Subject: Re: [PATCH] use unlocked io in getdelim
Date: Wed, 27 Aug 2008 06:28:58 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAki1SIoACgkQ84KuGfSFAYBeUQCeIS/ORNdm8wToWhwt2qnfuShT
GFEAoMmJ8wNYhDtLpSkPBWjEtgQz0Vsv
=NJhP
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]