This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] libio: Always use _IO_BUFSIZE for stream buffers [BZ #4099]
- From: Florian Weimer <fweimer at redhat dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 14 Mar 2016 12:08:13 +0100
- Subject: Re: [PATCH] libio: Always use _IO_BUFSIZE for stream buffers [BZ #4099]
- Authentication-results: sourceware.org; auth=none
- References: <56E17C8E dot 1070209 at redhat dot com> <20160311215230 dot B5AF32C3C1E at topped-with-meat dot com>
On 03/11/2016 10:52 PM, Roland McGrath wrote:
> Justify with clear rationale.
It fixes bug 4099. We need an arbitrary limit for that.
The libstdc++ buffer size is 8192 (or 8191), so this makes buffering
more consistent across the system.
The PostgreSQL people did extensive benchmarks to determine their
block/page size, and settled for a 8192 (but they do not use stdio
streams, for obvious reasons).
<stdio.h> documents BUFSIZ as the default buffer size. The new
implementation matches that.
Additional memory consumption is limited because file descriptors are a
scarce resource.
I can do some benchmarking, but I don't expect any compelling results.
Florian