Re: pipe buffer sizes

From: Jan Kandziora (jjj_at_gmx.de)
Date: 01/12/05


Date: Wed, 12 Jan 2005 20:26:17 +0100

Bram Stolk schrieb:
>
> $ mpeg2dec | cat > /tmp/l
>
cat is a very slow software as it reads the input stream in very small
chunks. Rule: Never use cat, aside from concatenating files.
IMHO "cat" should refuse to work if not at least two input files are given.

To have a comparision, use buffer like you did above with cat.

$ mpeg2dec | buffer >/tmp/l

>
> My feeling is, that this can be faster.
>
The goal is to minimize context switches. As your writer seems to write big
chunks, change the reader so that it reads big chunks.

-- 
Jan


Relevant Pages

  • Male reasoning (sorry Ed, Neal)
    ... I'm still wondering how this turned into my fault. ... mention "so it's better to spew chunks for a long trail rather than ... the corner when the cat started blowing chunks. ...
    (sci.med.transcription)
  • Re: Male reasoning (sorry Ed, Neal)
    ... Oh heck, I think that's kid reasoning, too. ... sitting at the computer across the room, and the cat was lying on the table right next to him. ... I mention "so it's better to spew chunks for a long trail rather than just one spot?" ... Now this is a good 15 feet from the door of the utility room, and he had to turn a small corner to get there, yet he is blaming me for the 15-foot long chunk trail because I had left the vacuum in the doorway of the utility room. ...
    (sci.med.transcription)
  • Re: Malloc
    ... sometimes relevant for binary files. ... Absolutely - as referenced by it's definition of "concatenating files". ... typically treat cat as a pipeline source rather than a utility to look at ...
    (comp.lang.c)
  • Re: Comfortable source file size?
    ... > What is the biggest source file you're comfortable with, ... > decide to break it into smaller chunks? ... or 5 screens is about my limit. ... But since I use make to cat the ...
    (comp.lang.tcl)