>> Why not just exposing the read buffer size as a configurable parameter ...
Take a look at the (and I quote) "Hairy buffering mechanism for grep" input buffering code in the grep source file grep-3.3/src/grep.c, then you tell me why it's not a runtime variable parameter <grin>. In other words, the input (and output) i/o buffering and performance tuning for various situations and kinds of files has been tuned and refined over many years. Doing something to the code, such as making buffer size a run time adjustable parameter, would probably not be easy, would risk making one usage of grep slower in order to make some other usage faster, and would risk some nasty bugs. -- Paul Jackson p...@usa.net