mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
Lazy loading is a little too lazy - Load new content a little earlier and not just in the last row #383
Labels
No labels
ai
android
api
auth
awesome
bug
bug
ci
cli
config
database
declined
deprecated
docker
docs 📚
documents
duplicate
easy
enhancement
enhancement
enhancement
epic
faces
feedback wanted
frontend
hacktoberfest
help wanted
idea
in-progress
incomplete
index
invalid
ios
labels
live
live
low-priority
macos
member-feature
metadata
mobile
nas
needs-analysis
no-coding-required
no-coding-required
observability
performance
places
please-test
plus-feature
priority
pro-feature
question
raspberry-pi
raw
released
released
released
research
resolved
security
sharing
tested
tests
third-party-issue
thumbnails
upgrade
upstream-issue
ux
vector
video
waiting
won't fix
won't fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/photoprism#383
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RAYs3T on GitHub (Aug 13, 2020).
Originally assigned to: @lastzero on GitHub.
When you scroll trough the pictures, new content is only loaded once you reach the last row.
This leads to empty fields while scrolling.
The next page should already load once you approach the last two or three rows.
@lastzero commented on GitHub (Aug 13, 2020):
Might also point to a performance issue, new results typically load very fast. Those gaps are the result of stacked results as the database counts files while we show photos.
@RAYs3T commented on GitHub (Aug 13, 2020):
They are fast, no question. But it is still anyoing if this interrupts your "smooth scrolling" (it comes to an hard end for 1-2 seconds)
@lastzero commented on GitHub (Aug 13, 2020):
Alright, thanks for your feedback! Going to optimize this further after our release.
In fact, the next page might already be in memory since we perform preloading for the lightbox / photo viewer. But there are also a million things that can go wrong. We better don't mess with it shortly before a stable release.
@danielo515 commented on GitHub (Nov 6, 2020):
I was about to open a similar question, but I think it is worth discussing it first here since this is about lazy loading.
IMO lazy loading should happen earlier and load less photos. In my laptop photoprism feels slow, and I think that is because it loads too many photos and then has to render too many of them.
Here is a comparision, when I reach the end of the row, this is the count of requests:
121 requests per page, and, it feels to much. If you were loading way less (let's say, 20) but you fetch more as the page scrolls about the 50%, the feeling would be much more smoother.
Even if some images show up without being loaded, a nice fade in animation will give you the impression that it is loading faster.
For reference, here is the count of network request when I scroll half page on pig.js:
And when I scroll several times, and relatively fast:
In the first case, when I browse slowly I get less network load, and when I browse faster I get more network load, but in any case I get as many request in flight as with prism
Another cool feature of pig.js is that it allows me to scroll the entire content. For example, I can just pick the scrollbar and move it to the bottom. If an image with a network request that is in-flight scrolls out of the view, then the request is cancelled.
@lastzero commented on GitHub (Nov 8, 2020):
@danielo515 Frontend rendering should be optimized independently from how the API works, see #500
Since a new database query is performed every time you request search results and there might be quite some latency between client and server, it's often not helpful to load data in tiny batches.
@benjaminknauer commented on GitHub (Jan 19, 2021):
Please consider using
content-visibility: autoto increase performance when many images are displayed:https://web.dev/content-visibility/
@lastzero commented on GitHub (Jan 19, 2021):
Thanks, going to give it a try 👍
@StephenBrown2 commented on GitHub (Jan 19, 2021):
No support in Firefox: https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility
@benjaminknauer commented on GitHub (Jan 20, 2021):
Right, but can be implemented with almost no effort and a possibly strong performance improvement for Chrome users.
Our company sees large benifits in performance via web vitals.
https://youtu.be/FFA-v-CIxJQ
@voronond commented on GitHub (Feb 20, 2022):
Are there any updates regarding this? I have like 40 000 photos saved and whenever I scroll down the page I usually need to wait 3 seconds, before new photos get loaded up.
Thank you.
PS: I absolutely love your application! That huge number of features it provides is amazing.
@lastzero commented on GitHub (Feb 20, 2022):
Note that the query performance may depend significantly on the selected sort order. Also, there may have been a "bug" that prevented thumbnails from being cached:
Have you already read the Performance Tips section of our docs?
https://docs.photoprism.app/getting-started/troubleshooting/performance/
@RAYs3T commented on GitHub (Mar 2, 2022):
Having seen this now on multiple installations with different hardware (performance-vise), I think it would be great if an option is added for the user to customize the amount of prefretched media. It's just anoying if you try to scroll fast and it stops to load the row. There is only so much you can optimize in the terms of storage. If the fetch-new request is just fired too late you will still see the higup in the UI.
@lastzero A (default not set ) environment variable wich can be set in docker-compose would be enough. I see your approch with "keep it simple" and mostly agree, but this starts to get annoying if your don't organize your photos in albums a lot and have to quickly scroll trough them to search a specific one.
@lastzero commented on GitHub (Mar 2, 2022):
I get it can be annoying, depending on the use case. Best we can offer short term are the Performance Tips in the docs. We just put our last bit of energy in the upcoming release which once again includes lots of major improvements, see Release Notes.
Please spread the word so we can eventually generate enough income to build a larger team, deliver faster, and work on more issues at the same time 💐
I promise scroll performance will be epic once we have a second to work on it.