xbufio += SeqReaderAt - buffering wrapper for a io.ReaderAt optimized for sequential access
For example in ZODB FileStorage format reader routines are written working with io.ReaderAt for the following reasons: - for loads random-access is required, - there can be several concurrent loads in flight simultaneously. At the same time various database iterations (APIs additional to load) use sequential access pattern and can be served by the same record reading routines. However with them we cannot use e.g. bufio.Reader because it works with plain io.Reader, not io.ReaderAt. Here comes SeqReaderAt: it adds a buffer, by default 2·4K, on top of original io.Reader, automatically detects direction of sequential access which can be forward, backward, or interleaved forward-backward patterns, and buffers data accordingly to avoid many syscalls e.g. in os.File case.
Showing
xbufio/seqbuf_ioat.go
0 → 100644
xbufio/seqbuf_ioat_test.go
0 → 100644
Please register or sign in to comment