-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Currently the index is built:
- On calls to
zran_seek(n)
- the index is bulit to cover up to positionn
in the uncompressed data - On successive calls to
zran_read
- when reading from position 0, one seek point is created at the beginning of the stream, but then no more points are created. If another call tozran_read
is then made, the index is built to cover up to the position that the previouszran_read
call finished - data is re-read and re-decompressed from the beginning of the file/stream. Then the read is initialised from that point.
This is complicated and inefficient - zran_seek
should just update an internal offset into the uncompressed data, without doing anything else. Then zran_read
should both read data and build the index in a single pass.
To support pre-generating an index, without reading any data, zran_read
could allow buf
to be NULL
, which would cause it to read/build the index, but not copy any data.
piskvorky
Metadata
Metadata
Assignees
Labels
No labels