Skip to content

Finding local .zim files takes a very long time ~15 minutes #3646

@tigran123

Description

@tigran123

Describe the bug

On Android 12 running on Samsung Galaxy Note10+ phone it took 14 minutes 5 seconds to find just two .zim files.

Expected behavior

Should take a few seconds. Actually, reading a directory and discovering those files should take 2-3ms, but assuming x1000 application overhead it should still complete in a couple of seconds, no more. Also, allowing one more second for reading and parsing the metadata I would say the maximum allowed time for this is 3 seconds. However, if the .zim file architecture is wrong, i.e. if the file is compressed (the 'z' in the name gives this hint) AND the metadata is stored inside the archive, then it would take about 15 minutes to access 100GB files, which is very bad, because this sort of processing should not depend on the filesize. To test this theory I would have to try with the smaller .zim files.

Steps to reproduce the behavior:

  1. Copy two zim files to /Android/media/kiwix. I used WikiPedia English (102GB latest) and WikiPedia Russian (33GB latest).
  2. Go to Android Settings and stop Kiwix app.
  3. While in the Settings clear cache and data of the Kiwix app
  4. Start Kiwix app and give it appropriate permissions
  5. Go to Kiwix and select Settings from the menu
  6. Point to External in Settings and select /Android/media/kiwix directory (making sure that it does point to External device first)
  7. Give the appropriate permission by clicking on "Use this directory" button
  8. Go to the Library tab of Kiwix and on another device start the timer
  9. Observe that the two .zim files will be discovered in 14 minutes and 5 seconds. And this is on a very fast Note10+ smartphone with a very fast 1TB microsd card, so on a lower-end configuration it will take even longer.

Screenshots

Environment

This problem was also mentioned in #3604

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions