On Fri, Jan 09, 2009 at 06:39:27PM +0000, Luke Kenneth Casson Leighton wrote:
further up the strace files, i'm looking at the biggest offender and it looks like it's reading files one byte at a time.
Certainly a normal unix shell has to read input (from stdin) byte by byte since it never knows when it might have to fork a process passing stdin through - and the child needs the correct file offset. (And the unix kernel doesn't have a 'read until newline' for files.)
If stdin is seekable or mapable there are other options, but that is difficult to detect and code for.
David