Commit Graph

14 Commits

Author SHA1 Message Date
Timothy Stack
db8a3c4d38 [debt] doing some cleanup
Defect Number:
    Reviewed By:
   Testing Done:
2020-11-09 22:17:17 -08:00
Suresh Sundriyal
f35f855458 [tests] Remove use of deprecated std::random_shuffle 2020-09-19 15:10:28 -07:00
Phil Hord
5513deeade Add a gzip indexing class for faster gz navigation
The gzread function is slow.  Every time you seek to a new location, the
whole file up to that position has to be decompressed again.  This causes
massive lags when trying to do simple things in lnav on a large .gz file.

Use the zlib inflate* functions instead and record the dictionary
periodically while processing the file the first time.  Then use
inflateSetDictionary to restore the dictionary to a convenient
location when trying to seek into the file again in the future.

Use a default period of 1MB of compressed data for syncpoints.
Each syncpoint uses 32KB. This is a ratio of 3.2%.  For example,
a 1GB .gz file (compressed size) will require us to keep 32MB
of index data in memory. A better method may be to use a fixed
number of syncpoints and divide the file appropriately. This
would keep the memory bounded at the cost of slower file
navigation on large .gz files.

Use pread to read the data for the stream decompressor and remove
the lock_hack previously employed.

NB. The documentation on these zlib functions is sparse. I followed
the example in zlib/examples/zran.c, but I used the z_stream total_in
and total_out variables instead of keeping my own separately as zran.c
does.  Maybe this is incompatible with some very old zlib versions.
I haven't looked.
2019-08-17 18:40:55 -07:00
Timothy Stack
02c53976b4 Some refactoring for the line buffer and other cleanups
Fixes #649
2019-06-15 06:32:02 -07:00
Timothy Stack
2589345e5c [perf] improve initial indexing times 2018-10-17 07:03:33 -07:00
Suresh Sundriyal
bfee33b7fd Turn on 'sign-compare' error check for tests. 2015-04-05 00:23:25 -07:00
Timothy Stack
a0ccbc9872 [build] quiet a format warning 2015-04-04 16:32:14 -07:00
Timothy Stack
9ff2d3774d [line_buffer] split long lines
Fixes #81
2014-03-15 04:40:58 -07:00
Timothy Stack
b6baae7730 [debug] more debugging stuff
Defect Number:
    Reviewed By:
   Testing Done:
2014-03-06 06:58:49 -08:00
Timothy Stack
c9d3914b6a [cppcheck] fix some nits 2014-02-19 06:29:13 -08:00
Timothy Stack
6a38619ac7 [piper] fix for partial lines when reading stdin 2014-02-19 05:58:31 -08:00
Timothy Stack
f62b5c271c [release] bump to 0.5.1 2013-05-02 23:02:03 -07:00
Timothy Stack
c4e9f58bf0 [bugs] fix some long-standing bugs
* grep_proc.cc: When a request is queued with the start line
   == -1, we need to start searching from the highest line
   ever seen and not the last line processed.
 * line_buffer.cc: If a partial line was read, we need to
   avoid returning another line if more data is appended
   to the file.
 * lnav.cc: Accept file name patterns on the command-line that
   don't match any files yet.  Initialize the screen before
   redirecting stderr to the log file or /dev/null.
 * log_format.hh: Add some comments.  Start to add back support
   for scrubbing.
 * logfile_sub_source.cc: Move scrubbing to the format impl.
 * textview_curses.hh: Add comments.
2012-09-22 16:15:15 -07:00
tstack
b4ec432515 first commit 2009-09-13 18:07:32 -07:00