Optimize LocalZipStorageHandler
to avoid reopening ZIP file for each WARC record lookup
#25
Labels
cleanup/optimisation
Refactoring or other code improvements
Currently, the
LocalZipStorageHandler
reopens the ZIP file for each WARC record lookup and when fetching the index. This approach is inefficient and should therefore be optimized.Proposed Changes
Use a context manager or an initialization process to open the ZIP file once and keep it open for subsequent operations.
Ensure the file is properly closed when the
LocalZipStorageHandler
instance is no longer needed (e.g., implement__enter__
and__exit__
methods).Tasks
LocalZipStorageHandler
to keep the ZIP file open during its lifetime.__enter__
and__exit__
methods to support proper resource cleanup.The text was updated successfully, but these errors were encountered: