[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: performance of shell read loops
Date: Mon, 7 Mar 2016 05:21:35 +0000
From: David Holland <dholland-tech%netbsd.org@localhost>
| pretty bad!
I thought I'd verify my assumption about echo, so modified (my already
modified) script by simply removing the "echo". Not the same test
at all, so the numbers aren't really comparable, but ...
andromeda$ time ./sh /tmp/script-nofork-sh
Then I ktrace'd it, and of course, the "read" builtin command is reading
one character at a time. If you think about it just a litte, you will
see that it must work that way (it is only permitted to take one line of
data from stdin, whatever follows the \n must be still available there for
the next command, whatever it is.)
That will account for essentially all that remaining system time.
Whether the user time can be improved at all will depend upon what
profiling eventually tells me (or someone else.)
Main Index |
Thread Index |