TrueVFS
  1. TrueVFS
  2. TRUEVFS-12

When mounting an archive file, don't cache its entry if it's STORED within a ZIP file.

    Details

      Description

      When mounting the virtual file system of an archive file which is located within another archive file, the Kernel currently extracts the entry representing the inner archive file from the outer archive file into a cache entry (flagged by FsInputOption.CACHE) first before opening the cache entry for reading. This allows the outer archive file to get updated with new content independently from the inner archive file.

      However, extracting the inner archive file adds to the run time when mounting its virtual file system which can be painful is the inner archive file is very large. This could be avoided if...

      (1) the outer archive file is a ZIP file and the inner archive file has been STORED rather than DEFLATED to it, and if....
      (2) it could be figured that updating the outer archive file independently from the inner archive file is not required by the application.

      This would require the following:

      (a) The class RawZipFile would need to provide a method (approximately named getReadOnlyFile(ZipEntry)) which returns a ReadOnlyFile which allows to read the entry directly.
      (b) The method ZipInputShop.getInputSocket would need to use this method for any STORED entry.
      (c) In the event of (2), either the method FsDefaultArchiveController.mount should not issue the FsInputOption.CACHE flag to its parent file system or the class FsCachingController.getInputSocket should ignore it.

      My assumption: This is a comparably big coding effort for its minor performance benefit - it really only helps when mounting large inner archive files from outer ZIP files.

        Issue Links

          Activity

          Hide
          Christian Schlichtherle added a comment -

          A part of the requirements has been addressed by TrueZIP 7.1, namely the API changes to the archive file driver required for (c) - see FsArchiveDriver.get(In|Out)putSocket

          Show
          Christian Schlichtherle added a comment - A part of the requirements has been addressed by TrueZIP 7.1, namely the API changes to the archive file driver required for (c) - see FsArchiveDriver.get(In|Out)putSocket
          Hide
          Christian Schlichtherle added a comment -

          If the ZipFile class could provide a SeekableByteChannel for STORED entries, then the FsCachingController might not need to create a cache entry for it.

          Show
          Christian Schlichtherle added a comment - If the ZipFile class could provide a SeekableByteChannel for STORED entries, then the FsCachingController might not need to create a cache entry for it.

            People

            • Assignee:
              Christian Schlichtherle
              Reporter:
              Christian Schlichtherle
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: