Skip to content

Conversation

nlepage
Copy link
Owner

@nlepage nlepage commented Aug 25, 2022

  • Stop reading all files content in memory
  • Read whole tar file once and record position of each file
  • Create a specific tar.Reader each time a file needs to be read
  • If the given io.Reader isn't an io.ReaderAt, fallback to reading the whole tar file in a buffer
  • Reimplement io.Seeker over tar.Reader to allow usage with http.FS

@nlepage nlepage added the enhancement New feature or request label Aug 25, 2022
@nlepage nlepage self-assigned this Aug 25, 2022
@nlepage nlepage force-pushed the feature/lazy-read branch from 50090ca to 8b97630 Compare August 25, 2022 14:00
@nlepage nlepage force-pushed the feature/lazy-read branch 8 times, most recently from 3cdc06e to b8b88e1 Compare August 26, 2022 15:13
@nlepage nlepage force-pushed the feature/lazy-read branch 2 times, most recently from 149705a to 687c368 Compare July 25, 2023 07:22
@nlepage nlepage force-pushed the feature/lazy-read branch 5 times, most recently from 407e63e to 4470b8a Compare July 27, 2023 14:18
nlepage and others added 8 commits August 9, 2023 22:39
use the offset to avoid iterating tar file when opening each file.

Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
after we've read the non-readerAt reader into a buffer, we now have a
readerAt either way, which simplifies code and no longer requires
separate buffers per file entry.

Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
Reading file content straight from the underlying reader was too straightforward.

Instead read from a new tar.Reader with an underlying reader pointing straight to the tar entry we want to read.
Should improve initial read of the tar file.
@nlepage nlepage force-pushed the feature/lazy-read branch from 30ec627 to 2aa91f4 Compare August 9, 2023 20:42
@nlepage nlepage marked this pull request as ready for review August 11, 2023 20:18
@nlepage nlepage merged commit c48d39a into main Aug 11, 2023
@nlepage nlepage deleted the feature/lazy-read branch August 11, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants