go-car icon indicating copy to clipboard operation
go-car copied to clipboard

blockstore: OpenReadOnly shouldn't need to parse the entire index into memory in some cases

Open mvdan opened this issue 2 years ago • 1 comments

Right now we always read and unmarshal an existing whole index into memory.

Luckily, IndexSorted is designed to allow using directly as a mmapped []byte from disk. If OpenReadOnly is called with a carv2 file that has a sorted index, we should use the index straight from the mmap.

cc @masih @willscott

mvdan avatar Sep 07 '21 16:09 mvdan