This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Faster reader (Re: Startup time in guile-1.3 (II))





>> It's completely insane to do that much work for every character
>> being read in the innermost loop of the reader.
>
>What about letting the reader read one full line (or more) at a time
>into an internal buffer and then use a simple character pointer to
>read the individual characters?

That is supposed to be exactly what fgets does internally. Although it
might be interesting to check just how efficient it is.

>(BTW, what was that pre_read and pre_write change about?  I saw that
 >pre_read seems to flush output when switching to read.  But isn't
 >this made automatically by STDIO?  I think reading is one of the
 >conditions when output is flushed.  What else did this change
 >handle?)

Apparently STDIO specs say it doesn't have to flush. If you don't it
stuffs things up on some platforms.

Therefore this patch to put things back how they were will presumably
cause other problems, that would need to be looked at.