seekable_format: Prevent rereading frame when seeking forward#3069
seekable_format: Prevent rereading frame when seeking forward#3069YoniGilad wants to merge 2 commits intofacebook:devfrom
Conversation
When decompressing a seekable file, if seeking forward within a frame (by issuing multiple ZSTD_seekable_decompress calls with a small gap between them), the frame will be unnecessarily reread from the beginning. This patch makes it continue using the current frame data and simply skip over the unneeded bytes.
|
While I understand the intention (reduce the nb of What happens when Could there be a test which shows the benefit and correctness of the change ? |
|
@Cyan4973 When I will work on adding a test into seekable_tests.c that performs multiple reads at different offsets. To measure the benefit I think I can use the |
This does the following: 1. Compress test data into multiple frames 2. Perform a series of small decompressions and seeks forward, checking that compressed data wasn't reread unnecessarily. 3. Perform some seeks forward and backward to ensure correctness.
|
I added a test that does the following:
|
|
Thanks @YoniGilad , |
When decompressing a seekable file, if seeking forward within
a frame (by issuing multiple ZSTD_seekable_decompress calls
with a small gap between them), the frame will be unnecessarily
reread from the beginning. This patch makes it continue using
the current frame data and simply skip over the unneeded bytes.