libzim icon indicating copy to clipboard operation
libzim copied to clipboard

Optimize handling of non-multipart ZIM files

Open veloman-yunkan opened this issue 3 years ago • 1 comments

Currently libzim treats all ZIM files as though they are multipart. In the light of the declining usage of multipart ZIM files, it makes (and has always made) sense to handle single-part ZIM files in a dedicated (simpler and more efficient) way. That can be done at no extra runtime overhead due to the polymorphic Reader interface. Current FileReader has to be renamed to MultipartFileReader, a more efficient implementation SinglePartFileReader has to be introduced, and the proper implementation must be selected based on the type of the input ZIM file.

veloman-yunkan avatar Sep 18 '20 16:09 veloman-yunkan

Just to point out that many Android phones sold still today do not have support for exFAT, and still use FAT32 for microSD cards. A good example are new Android handsets produced by Nokia. This is because some manufacturers do not want to pay the small licensing fee for exFAT use. So many more users than you may be aware of have multipart files that they have downloaded in-app onto a portable microSD card.

Jaifroid avatar Nov 01 '20 09:11 Jaifroid

@veloman-yunkan What would be the concrete benefits? To me it looks like this would be made the code clearer/cleaner. Do Îm right?

kelson42 avatar Nov 02 '22 12:11 kelson42

This is already done with https://github.com/openzim/libzim/pull/449 (especially the commit https://github.com/openzim/libzim/commit/eb167fad2ff3658d542d8c7e9718779e506fe5d1)

mgautierfr avatar Nov 02 '22 12:11 mgautierfr