GithubHelp home page GithubHelp logo

Comments (11)

Jaifroid avatar Jaifroid commented on May 19, 2024 1

Oh, OK, so I'd better update the app next week then. I'm going to update Kiwix-JS-Windows vanilla app to 0.9.9 Beta at the same time (I'll post new CHANGELOG shortly). Wikivoyage can probably wait a while (no equations AFAIK!).

It's marginally slower when decompressing one SVG at a time, but on desktop I don't notice it at all, and I hardly notice it on the 950XL. It's well worth the trade-off to be able to support lower-spec models.

from kiwix-js-pwa.

Jaifroid avatar Jaifroid commented on May 19, 2024

Oh dear. I see the issue is that the page has lots of equations on it, but this version of WikiMed does not have the alt text that enables the app to use MathJax. The problem is that decompressing SVGs is extremely taxing on xzdec.js. It uses a huge amount of memory. This article loads fine on my Lumia 950XL which has 3GB of RAM. I have attempted to fix the SVG problem by limiting the number of SVGs that get sent to the decompressor at a time, and I could try limiting them even more (they're currently sent in batches of 3). That might do the trick on lower-spec devices. But what would really fix the issue would be a fix for openzim/mwoffliner#164 .

from kiwix-js-pwa.

kelson42 avatar kelson42 commented on May 19, 2024

@Jaifroid Yes, was my guess too. My device has 1GB (in total of memory). I would suggest to try to reduce the batches from 3 to 2 and if this is still not enough even only 1 at a time to see if that fix the problem... even if this slow down a bit the loading in more powerful devices.

from kiwix-js-pwa.

Jaifroid avatar Jaifroid commented on May 19, 2024

Hi @kelson42 , I've compiled an appxbundle of Kiwix JS Windows (not with the packaged WikiMed ZIM) with the svgSliceSize variable set to 2. Could you possibly follow these steps to test on your device?

  1. Transfer a copy of wikipedia_en_medicine_novid_2018-01.zim to the phone, either with a USB cable, microSD card, or by downloading from the Settings page of Kiwix JS Windows.

  2. Uninstall Kiwix JS Windows from the device (no need to uninstall Wikivoyage or WikiMed -- we're just going to test with the generic app to avoid huge downloads, as we may need to test a few times with tweaked settings).

  3. Download the .appxbundle (only 4MB) in this GitHub directory and note download location:
    https://github.com/kiwix/kiwix-js-windows/tree/master/AppPackages/KiwixWebApp_0.9.8.0_Test
    For an optimal test, reboot the phone to clear RAM.

  4. Open File Explorer app, locate .appxbundle, install the package.

  5. Open the app, go to Settings and turn off "Remember last visited page" under Privacy settings (to prevent the startup loop in case of a crash).

  6. Go back to Home page and search for Hodgkin and Huxley and open page.

Let me know if this allows the page to load correctly. Also, if it still crashes, does it crash before any text is shown, or straight after the page is shown, or after some delay? If not fixed, we can try reducing to one SVG per batch. I'll be testing also on a low-spec device I have.

from kiwix-js-pwa.

Jaifroid avatar Jaifroid commented on May 19, 2024

On an old Lumia 920 hacked to run Windows 10 Mobile (it has 1GB of memory), I need an svgSliceSize of 1 for this article not to crash. It crashes with 2.

An .appxbundle with svgSliceSize set to 1 is available here for testing:

https://github.com/kiwix/kiwix-js-windows/tree/master/AppPackages/KiwixWebApp_0.9.81.0_Test

from kiwix-js-pwa.

kelson42 avatar kelson42 commented on May 19, 2024

@Jaifroid Thank you for all the effort and testing. If it works for you then I do not think it makes much sense to make to test as my device has also exactly 1Gb of memory. Could you please make directly an update of the Windows store? Or maybe you want to make other fixes?

from kiwix-js-pwa.

Jaifroid avatar Jaifroid commented on May 19, 2024

I can update the app in the Store, but since updates take 24-48 hours (business days only), if there is an updated ZIM of WikiMed about to come out, it would make sense to wait for it. The last one came out on 5th Jan, so if we're getting a new one on Monday or Tuesday, I might as well include it in the submission.

Even better would be a new WikiMed with the LaTeX/MathJax strings intact.......!

from kiwix-js-pwa.

kelson42 avatar kelson42 commented on May 19, 2024

@Jaifroid Next update of the ZIM file is going to happen in March. By the way: is that really slower to tackle one SVG file at a time (instead of 3)?

from kiwix-js-pwa.

Jaifroid avatar Jaifroid commented on May 19, 2024

@kelson42 No rush, but when you're able, please confirm that this bug is now squashed on your 1GB device (ensure the app has updated to 0.9.9 first -- it will inform you on first run after update, or check the About page). To hasten the download, go to Microsoft Store -> Hamburger menu -> Downloads and updates, and if necessary tap Get updates. It should be a small update (code only, the ZIM does not get downloaded again).

from kiwix-js-pwa.

kelson42 avatar kelson42 commented on May 19, 2024

@Jaifroid With last Wikimed the app does not crash anymore. But is true it is a bit slow to get all pictures/equations displayed. But it works! :)

from kiwix-js-pwa.

Jaifroid avatar Jaifroid commented on May 19, 2024

Thanks @kelson42 . Better slow than crashing! The slowness should only affect a page like this with lots of svg equations. Normal png/gif/jpeg pictures should be no problem for the app. With all image types it starts decompressing only the images in the current viewport, and then prefetches up to 20 images further down the page, then stops and waits for the user scrollstop before decompressing more.

Anyway, hopefully SVG equations will be a fallback only if you can get mw-offliner to include the MathJax strings again as alt text. I think that's essential for the maths wikis. It's 1000% faster to typeset with MathJax.

from kiwix-js-pwa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.