Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy load of header index #2

Open
chrisjsewell opened this issue Nov 8, 2020 · 0 comments
Open

Lazy load of header index #2

chrisjsewell opened this issue Nov 8, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@chrisjsewell
Copy link
Member

In read-mode, zipfile.ZipFile loads the entire index on initiation (to a list of ZipInfo), which is very unperfomant for archives with large amounts of files (for a million archived files, the index can be ~1 Gb in RAM).

For tarfile.TarFile the index is not read on initiation, but is whenever tarfile.TarFile.getmember is called (to a list of TarInfo). There is tarfile.TarFile.next() which reads the next index header and adds it to tarfile.TarFile.members.

Ideally with both the index would only be read up to when it is needed (e.g. when searching for a particular file to open)

@chrisjsewell chrisjsewell added the enhancement New feature or request label Nov 8, 2020
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

No branches or pull requests

1 participant