Russ Allbery <[EMAIL PROTECTED]> wrote:
> Len Budney <[EMAIL PROTECTED]> writes:
>
> > Yes, but 5-6 orders of magnitude less expensive than physical
> > writes. If I had incurred, but discounted, physical latencies, I would
> > be a jackass. Instead I simply made a decision you don't care for,
> > which I would reverse in the face of actual performance data.
>
> 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.
Sounds believable. I benchmarked safecat using write(,,1) and putc(),
and got a factor of at worst 2 (in wall-clock time). My benchmarks
weren't terribly exhaustive, since they didn't cover a range of
filesystems, and no control was exercised over system load/application
mix.
I'll probably rewrite safecat on general principles anyway, but so far
nobody has reported that it was their bottleneck. Mr. Sam's ``I can't
even emulate putc correctly, and I'm too stupid to simply _use_ putc''
benchmark was pretty underwhelming.
Len.
--
Finally, anti-spam rules are vulnerable to the anti-fax effect: they are
useful only if they aren't very widely used.
-- Dan Bernstein