libzim
libzim copied to clipboard
Optimize handling of non-multipart ZIM files
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.
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.
@veloman-yunkan What would be the concrete benefits? To me it looks like this would be made the code clearer/cleaner. Do Îm right?
This is already done with https://github.com/openzim/libzim/pull/449 (especially the commit https://github.com/openzim/libzim/commit/eb167fad2ff3658d542d8c7e9718779e506fe5d1)