-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
[Bug Report] Long home page loading time for large libraries #81
Comments
If the caching is server-side that could work, but if it was a local device cache then that kinda prevents switching reading across devices. Unless you are going to scan very often, which is then a waste of resources. Are you currently scanning every single file when the Home page loads? |
For Regarding
At some point down the line, I think the final solution will be to store all this in the database. Then we could take advantage of indexes etc. But until then some of the options listed above should hopefully help. |
@cglatot Yes, I plan to do server-side caching. Currently, the file metadata (e.g., data added, reading progress, last read time, etc.) is stored in a file named @jaredlt Good points! Yes, it's reasonable to do it as part of the periodic library scan, but we have to be careful not to make the scan time even longer (#79). I haven't got the time to do a real benchmark, but browsing the source code I suspect the bottleneck is the IO. Each |
@hkalexling - if the Home page optimizations still do not improve the load time enough, would it not be possible to have a json file strictly for reading progress? That way when loading Home you are only reading a single file for progress instead of having to open every series' JSON. I guess the issue with that is that every time you update the reading progress you would need to do it in 2 places (unless you move it ALL to a reading-progress.json and use that for everything). |
@cglatot As mentioned in the original comment #37 (comment), we don't use a DB or a central JSON file because it's difficult to point to a specific file. Let's say you store reading progress in a {
...
"/home/user/mango/library/One-Punch Man/Ch.126.cbz": "100%",
"/home/user/mango/library/One-Punch Man/Ch.127.cbz": "90%",
...
} If the I've made some changes in 9d76ca8, which greatly improves the home page load time. I tested it with a library containing over 10k entries and the page is loaded within 800ms, so I think the bulk-loading optimization is enough. |
Fixed in v0.7.2. Thanks for the bug report! |
Can confirm - Home used to take about 8+ seconds to load, now takes about 800ms! Thanks :D |
As noted by @cglatot in #79 (comment), the home page takes a long time to load when the library has over 1,000 entries.
With the newly introduced home page in v0.6.0, Mango has to check the reading progress of all entries in the library to display the "continue reading" and "recently added" sections, and so the page takes a long time to load if you have a lot of entries. Perhaps we could improve this by caching the two sections and updating them with a regular background task (similar to the library scan). @jaredlt It would be great if we could have your opinion on this.
The text was updated successfully, but these errors were encountered: