grep extremely slow
Rob Landley
rob at landley.net
Sat Apr 8 01:56:14 UTC 2006
On Friday 07 April 2006 3:24 am, Rich Felker wrote:
> I've observed that busybox grep is still 20x slower than gnu grep,
> even with the regcomp issue I reported a while back fixed. The problem
> seems to be the bb_get_chunk_from_file function, which reads a single
> character at a time from the file using getc. Not sure what's the best
> way to fix it without breaking semantics needed by other applets..
> anyone care to take a look?
In theory this getc should be using fopen() with a FILE *, and thus copying a
character at a time from a buffer rather than doing a syscall each time.
The problem is we don't want to read more data then we end up using, because
there's no guarantee our input is seekable.
> Rich
Rob
--
Never bet against the cheap plastic solution.
More information about the busybox
mailing list