bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib portability issues


From: Eric Blake
Subject: Re: gnulib portability issues
Date: Mon, 11 Jun 2012 06:10:02 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

On 06/09/2012 10:25 PM, Rich Felker wrote:

> While fixing the underlying freadahead function would be nice, it
> might be better to make sense of WHY it's needed/wanted, if it's even
> actually useful, and how to avoid the need for it in the first place.

GNU M4 (at least the master branch, although it has not yet been
released as m4 2.0) _wants_ to use freadahead, because it provides at
least a 10% speedup in operation.  It _really is_ more efficient to peek
at the current buffer in one function call than it is to call multiple
fgetc_unlocked(), in order to rapidly search for the next character of
interest.  If nothing else, you would be wise following the lead of
Dragonfly and providing an internal __freadahead function with the
semantics that gnulib wants, if you don't want gnulib messing around
with FILE* internals directly, because it really does provide noticeable
improvements.

Furthermore, I'm considering writing a proposal for the next version of
POSIX to standardize several of the stdio functions currently provided
by gnulib, along with rationale why they are useful and how they can be
used to speed up programs.  The fact that gnulib is an existing
implementation on top of multiple stdio implementations should be reason
enough to treat it as something worth making standard.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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