Skip to content

Extremely slow file handling with archives in Android #42

Open
@Jaifroid

Description

@Jaifroid

Issue was initially discussed and diagnosed over at kiwix/kiwix-js-pwa#343. There, I thought the issue was with Emscripten's WORKERFS. However, using the test case in this Repo for large file access, and debugging on a Chromium instance on a midrange Samsung Android, the WORKERFS has no problem loading and reading (instantly) a 92GB Wikipedia ZIM from a microSD card. See screenshot below. If we can read bytes from the end of the file nearly instantly, why is javascript-libzim getting such awful performance? Loading Ray Charles into the WASM on Android takes 30 seconds in Samsung Internet (a Chromium browser), and nearly 90 seconds in Chrome. I was unable to load anything larger than 500MB into either instance.

The slowdown is mostly in relation to instantiating the archive. Once the archive has registered, full-text searching is reasonable. This is why I initially thought the issue was to do with passing the ArrayBuffer to the Web Worker, but big file test does this instantly. @mgautierfr would you have any thoughts on what could be going on here?

image

NB we can't test on Firefox because Firefox on Android attempts to copy picked archives into memory (or possibly an internal file system), and crashes on anything larger than about 2GB.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions