kiwix-js
kiwix-js copied to clipboard
Only load the zstd or xz decoders when needed
We currently load both zstd and xz decoders into memory when the app starts up. This increases the memory footprint of the app and is unnecessary (both have to be compiled by the asm or wasm engines, and memory has to be allocated to the Emscripten instance), whereas in practice no one ZIM ever has both types of compression.
There is no way to know the compression type of a specific ZIM until the app reads the header of a compressed cluster. Only at this point should the required decoder be loaded and instanitated.
I wonder if this ticket still makes sense considering that we will follow the emscripten compiled libzim path?
Same reply as in #745. Once we have a version of libzim acting as our backend, we'll be able to close this as unneeded.
Now that libzim is available as wasm and loaded here in kiwix-js, sounds possible to close it?!