-
Notifications
You must be signed in to change notification settings - Fork 8
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
Laggy / slow gallery (large libraries — sometimes) #41
Comments
Maybe even split up the json into chunks, so that the browser doesnt have to parse gigabytes of metadata at once :D |
It would be ideal to load the books in chunks to reduce the initial page load time, but I'm not sure if I'll ever be ready to do that at this point as I hadn't considered it in the beginning and it would require way more refactoring than the current This is a rough estimate, but 3000 books would amount to maybe ~11-14MB. I'll consider it again if it becomes an issue. |
I still got a bunch of small issues to resolve…
Details about the fix: I fixed it according to the original plan, but went for a hybrid solution where vertical scrolling updates URL param
Pros:
Cons:
At first when I was building this lazy load system I made it so that if you loaded a page with book details open, It would load one book and nothing else, but with a button that says "Expand view (200)" parenthesis had the number of books in the collection... and when you click it. it would show everything in the collection. This I thought was an ok compromise, however I changed my mind when I realized that backwards navigation (back button in the browser) would always reset the view and throw you to the top. This was super irritating and so this current solution ended up being the lesser evil... I suppose. |
… to smaller chunks. Related to #41
It depends on what kind of computer you are using. You could see it happening on an old laptop or perhaps you don't see it at all. I'm seeing this on slightly older mobile devices when the library exceeds about 600 books.
It basically lags when you do anything:
Proposed fix:
Currently, there's basically a kind of a pseudo lazy load that keeps track of every single book's position and then renders rest of the information when the books enter the viewport on scroll. So the solution I'm going for is to further the same idea by loading books in chunks so the original solution doesn't have to keep track of so many books at once. Note: the position tracking ends when the book is fully rendered. This solution doesn't affect the initial page load time.
The text was updated successfully, but these errors were encountered: