Re: Official request: Please make GNU grep the default

From: Tim Kientzle <tim_at_kientzle.com>
Date: Sun, 15 Aug 2010 15:07:51 -0700
On Aug 15, 2010, at 12:49 PM, Dimitry Andric wrote:
> So my first quick fix attempt was to replace the home-grown grep_fgetln
> with fgetln(3), which is in libc.  This does not support gzip and bzip2
> files, but just to prove the point, it is enough.  It gave the following
> profiling result:

FYI:  libarchive has some pretty heavily-optimized
bulk I/O routines and handles automatic decompression
(including gzip, bzip2, lzma, xz, lzip, compress,
and soon uuencode).

There's a trick supported in libarchive now that
will let you just use it's automatic decompression
features on non-archive files (via "format_raw").
Unfortunately, it provides binary blocks of data;
there's no nice line-reader interface.

There's an effort afoot to refactor libarchive
so that the stream I/O and compression/decompression
support is actually a separate library that should
be very useful for this sort of usage.  As part
of that, we plan to add some line-oriented
I/O features that should be noticeably more
efficient than stdio.

Cheers,

Tim
Received on Sun Aug 15 2010 - 20:08:01 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:06 UTC