On Thu, Feb 24, 2000 at 06:48:50PM -0800, Russ Allbery wrote:
 
> W. Richard Stevens did that benchmark in _Advanced Unix Programming_ quite
> a while back; as I recall, the difference between single-character writes
> and buffered writes in his data was an order of magnitude or two.

of course. 

lrz, buffered file write: (fwrite)
Bytes received:  335868/ 335868   BPS:3251764
Bytes received:  346199/ 346199   BPS:2601924

lrz, buffered file write: (putc)
Bytes received:  336079/ 336079   BPS:2837811
Bytes received:  346199/ 346199   BPS:2247884

lrz, unbuffered file write: (write, single bytes)
Bytes received:  335936/ 335936   BPS:87863
Bytes received:  346199/ 346199   BPS:87847

Using unbuffered I/O where one can use buffered I/O wastes performance,
due to context switch slowness.

Regards, Uwe

Reply via email to