Re: Is BUFSIZ too small ?

From: Dan Nelson <dnelson_at_allantgroup.com>
Date: Thu, 22 Jan 2004 12:09:19 -0600
In the last episode (Jan 22), Ian Freislich said:
> "Poul-Henning Kamp" wrote:
> > In message <200401192111.i0JLBYVk004060_at_apollo.backplane.com>, Matthew Dillon
> > writes:
> > >:I noticed that we still have BUFSIZ in stdio.h defined to only
> > >:1024, and wonder if that should be increased these days.
> > >:
> > >:Is there anybody who could devise and run some benchmarks to find
> > >:out what effect it would have to increase it to for instance
> > >:4096?
> > >
> > >    Very few programs use BUFSIZ for the actual I/O ops [...]
> > 
> > I share many of your doubts, but I would still like to see some
> > benchmarks :-)
> 
> Perhaps ftp is one of those things that uses BUFSIZ for the actual
> I/O ops.  All of it's reads and writes if you truss it are 1024 bytes
> which impacts its performance (here at least).

Yeah, it's not so much stdio's use of BUFSIZ, it's other applications
using it for their preferred I/O size.  I upped the buffer size in ftpd
locally because of this.  There are a lot of references to BUFSIZ in
the base system's code, but they're mainly just for reading in a config
file, for example, or misused as sizing a filename buffer.  ftpd and
lpr jumped out as really wanting larger I/O sizes.

-- 
	Dan Nelson
	dnelson_at_allantgroup.com
Received on Thu Jan 22 2004 - 09:09:21 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:39 UTC