Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding dirEntry and block cache #619

Closed
Jaifroid opened this issue May 10, 2020 · 0 comments · Fixed by #658
Closed

Consider adding dirEntry and block cache #619

Jaifroid opened this issue May 10, 2020 · 0 comments · Fixed by #658
Assignees

Comments

@Jaifroid
Copy link
Member

Jaifroid commented May 10, 2020

@mossroy As you know, @peter-x worked on (and completed) a dirEntry and block cache feature for Kiwix JS.

When I was trying to optimize Kiwix JS for Android browsers (#581), in desperation I tried it out in Kiwix JS Windows, and found it to make a huge difference. Coincidentally for #617, where peter-x's code makes a really noticeable difference is in title search in slow binary search contexts (IE11, FFOS, Android and, believe it or not, Chrome [even on a PC] which is significantly slower at binary search than Firefox, probably due to its file-handling).

I integrated peter-x's code into Kiwix JS Windows, and you can do a simple test of the rather dramatic search speed gain by going to https://kiwix.github.io/kiwix-js-windows/ in IE11 and loading a big ZIM like full English Wikipedia. Then search for "the second world war", and you will see how much faster the search is even than Chrome running kiwix-js.

It's almost no work to integrate the cache into Kiwix JS. I'd be happy to do it, but I understand that it was not merged at the time because it was not felt to make enough of a performance gain. With the heavier binary searches that near-case-insensitivity introduces, it now does make a significant gain IMHO. I leave it to you to decide whether you wish to have this for Kiwix JS.

PS If you visit the Kiwix JS Windows implementation in Chrome or Firefox, and you have visited it previously, you may need to delete the service worker cache to be sure you are immediately running the latest code: Dev Tools -> Application -> Cache Storage -> right-click sw-precache -> Delete, then reload browser with Ctrl-Shift-R followed by Ctrl-R.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant