httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <>
Subject Re: cvs commit: apache-2.0/src/lib/apr/file_io/win32 readwrite.c
Date Fri, 16 Jun 2000 08:41:02 GMT
On Fri, 16 Jun 2000 01:03:43 -0700, Greg Stein wrote:

>On Fri, Jun 16, 2000 at 02:47:48PM +1000, Brian Havard wrote:
>> On Wed, 14 Jun 2000 14:59:07 -0700, Greg Stein wrote:
>> >Woah!
>> >
>> >Hey... if the file is non-buffered, then the performance here is going to
>> >suck hard. The old version would read a chunk, then back up the file pointer
>> >to where the newline was found. That should be much faster than reading a
>> >byte at a time, until a newline is hit.
>> >
>> >Seriously, I think this change should be backed out. Or at least use
>> >ap_read() only in the buffered case.
>> If speed is an issue then it should have buffering turned on. Win32 is the
>> only version that had this seek back & forth style ap_fgets.
>I don't necessarily agree that buffering is the way to get speed.

Why not? It does just that.

>Geez, do I
>now need to go through all my open calls and say "do I want this to go fast
>or slow? Well, fast of course. I guess that means that I should enable
>That is just a bit bogus :-)

Well, I guess it could be turned on by default. The only times you wouldn't
want buffering would be:

- Already buffering elsewhere (BUFF)
- Always read/write large blocks
- Don't want to lose written data on abnormal termination (logs)

>And what is wrong with the back/forth style? It beats reading a byte at a
>time hands down!

It's kinda clever but buffering supercedes it IMHO.

 |  Brian Havard                 |  "He is not the messiah!                   |
 |  |  He's a very naughty boy!" - Life of Brian |

View raw message