immich icon indicating copy to clipboard operation
immich copied to clipboard

Very laggy on Android mobile app when scrolling on default photos view

Open maltokyo opened this issue 1 year ago • 37 comments
trafficstars

The bug

When scrolling on Google photos, the scrolling is extremely smooth even when scrolling too fast for full thumbnails to load. On Immich this is very laggy. Granted I have 100k photos, so not sure if that's the issue but it should still work. Attached a screen recording of me scrolling at a constant speed, and the laggy scrolling is clearly visible.

Link to video https://youtube.com/shorts/D0theLCMa4s?si=ZsPg36C8EhGr6ktO

The OS that Immich Server is running on

android 14

Version of Immich Server

v1.115

Version of Immich Mobile App

v1.114

Platform with the issue

  • [ ] Server
  • [ ] Web
  • [X] Mobile

Your docker-compose.yml content

Stock standard docker compose. With Intel HW acceleration on.

Your .env content

Standard env

Reproduction steps

  1. Scroll on photos screen through many photos at medium pace (constant pace)
  2. Observe lagging ...

Relevant log output

No response

Additional information

No response

maltokyo avatar Sep 14 '24 12:09 maltokyo

What device are you using? Try enabling "prefer remote images" in the advanced settings.

bo0tzz avatar Sep 14 '24 13:09 bo0tzz

What device are you using? Try enabling "prefer remote images" in the advanced settings.

This does not work.

Related issue: https://github.com/immich-app/immich/issues/11113

Cookie-Monster-Coder avatar Sep 14 '24 13:09 Cookie-Monster-Coder

Google pixel 8 pro. All my images are remote anyway. You can see twy only have the cloud icon on them.

On Sat, Sep 14, 2024, 3:15 PM bo0tzz @.***> wrote:

What device are you using? Try enabling "prefer remote images" in the advanced settings.

— Reply to this email directly, view it on GitHub https://github.com/immich-app/immich/issues/12674#issuecomment-2350988088, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKS7WYG32GEQVL3PENGQY3ZWQZIZAVCNFSM6AAAAABOGZW6EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJQHE4DQMBYHA . You are receiving this because you authored the thread.Message ID: @.***>

maltokyo avatar Sep 14 '24 13:09 maltokyo

Anyway have turned on prefer remote images setting. It's still the same. Very laggy and slow to scroll.

On Sat, Sep 14, 2024, 3:45 PM Mal Page @.***> wrote:

Google pixel 8 pro. All my images are remote anyway. You can see twy only have the cloud icon on them.

On Sat, Sep 14, 2024, 3:15 PM bo0tzz @.***> wrote:

What device are you using? Try enabling "prefer remote images" in the advanced settings.

— Reply to this email directly, view it on GitHub https://github.com/immich-app/immich/issues/12674#issuecomment-2350988088, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKS7WYG32GEQVL3PENGQY3ZWQZIZAVCNFSM6AAAAABOGZW6EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJQHE4DQMBYHA . You are receiving this because you authored the thread.Message ID: @.***>

maltokyo avatar Sep 14 '24 13:09 maltokyo

@maltokyo how many albums do you have? Did you start scrolling right away when you first open the app?

The stuttering is due to the albums sync mechanism compete with the UI thread, after the albums sync finished, it will be smoother.

Regardless, we have plan to optimize this process for a better user experience

alextran1502 avatar Sep 14 '24 13:09 alextran1502

Thank you for the replies. Yes I used a script to make albums from about 1000 folders. So, many albums. But immich has been installed for weeks. So I thought it maybe has had enough time to scroll correctly. Thanks for the news on optimizing this.

maltokyo avatar Sep 14 '24 13:09 maltokyo

@maltokyo the sync here check for the diff with the server, adding and removing assets on the mobile...etc, basically expensive operations that can be taxing for the client, and it runs when opening the app and after some certain actions.

alextran1502 avatar Sep 14 '24 14:09 alextran1502

Thank you. Everything is in sync. I haven't added any photos for many weeks. Nothing is there to sync.

On Sat, Sep 14, 2024, 4:03 PM Alex @.***> wrote:

@maltokyo https://github.com/maltokyo the sync here check for the diff with the server, adding and removing assets on the mobile...etc, basically expensive operations that can be taxing for the client, and it runs when opening the app and after some certain actions.

— Reply to this email directly, view it on GitHub https://github.com/immich-app/immich/issues/12674#issuecomment-2351003122, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKS7W62TSITE22K6PL5MSDZWQ63HAVCNFSM6AAAAABOGZW6EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJRGAYDGMJSGI . You are receiving this because you were mentioned.Message ID: @.***>

maltokyo avatar Sep 14 '24 14:09 maltokyo

@maltokyo maybe a better wording from is the operation of figuring out what to sync is taxing and competing with UI thread

alextran1502 avatar Sep 14 '24 16:09 alextran1502

@alextran1502 ok, is there anything I can do to get more data on this on my side, in order to find out what is causing the issue? Some way to get logs (and which ones?) from mobile or server, please let me know. Any way I can assist, I'm willing to of course.

maltokyo avatar Sep 14 '24 16:09 maltokyo

@maltokyo thanks for the offer, we already known the bottle neck and have plans to word toward improving it in the near future

alextran1502 avatar Sep 14 '24 16:09 alextran1502

Understood. Thanks a lot. Apart from this, everything is absolutely amazing.

maltokyo avatar Sep 14 '24 16:09 maltokyo

I'd also like to help debug this issue. For me the experience is even worse - the app takes a long time to load and becomes completely frozen for multiple seconds sometimes, most often directly after starting while synchronization takes place. Having "remove images preferred" activated at this point doesn't help, but it helps later during normal use. Maybe it's also my device but it should be that out-of-date and slow yet (Snapdragon 845, no SD card). I have ~23000 photos and 1500 videos totaling 32 GB.

Thanks for the hard work, for the rest I can only agree - Immich is amazing!

Probably related: #11113

Mitmischer avatar Oct 06 '24 07:10 Mitmischer

I experience the same issue. So far, I had attributed this to the age of my phone, but I just upgraded and still suffer from a laggy UI.

~ 20 seconds after opening the app, it becomes very fluid and responsive, corroborating the statement that this is connected to the synchronization.

Please let me know if you need more data.

sbillaudelle avatar Oct 07 '24 20:10 sbillaudelle

I experience the same thing on iOS. Did not have this issue until I imported a Google Takeout which added a ton of albums. Which, I only have 133 albums, which doesn’t sound like a ton.

orywig avatar Oct 13 '24 00:10 orywig

@orywig yeah the album sync is causing the competition with the UI thread at the moment. The looping over albums and each assets to calculate which one need to be add/delete/update is quite taxing, so we are working towards a fix

alextran1502 avatar Oct 13 '24 01:10 alextran1502

Thanks, @alextran1502! I should have mentioned I saw your comments above about there being a plan for this. I just wanted to note that it’s a iOS thing as well as Android. Thanks for all you do! Love the project!

orywig avatar Oct 13 '24 01:10 orywig

Until the team can resolve this issue, has anyone here found a temporary resolution or workaround? The lag while the albums are syncing is quite impactful to the user experience; especially when remote and this is happening across the internet. I can't think of anything besides just cleaning up and removing any unnecessary albums to shorten the sync time.

orywig avatar Oct 29 '24 02:10 orywig

I don't believe the full cause of this issue is albums syncing. I open up the app, wait 5 mins on the startup position, just taping the screen every so often so the phone doesn't go to sleep, after the 5 mins are up I start scrolling and it still crashes.

Cookie-Monster-Coder avatar Oct 29 '24 03:10 Cookie-Monster-Coder

@Cookie-Monster-Coder hmmm, what is your phone model? If you go to App Settings > Advanced > toggle Prefer Remote Image, does it help?

alextran1502 avatar Oct 29 '24 04:10 alextran1502

I also have the same, open app, wait 20-30 mins even.. and lags and crashes still. I'm on pixel 8 pro.

On Tue, Oct 29, 2024, 5:33 AM Alex @.***> wrote:

@Cookie-Monster-Coder https://github.com/Cookie-Monster-Coder hmmm, what is your phone model? If you go to App Settings > Advanced > toggle Prefer Remote Image, does it help?

— Reply to this email directly, view it on GitHub https://github.com/immich-app/immich/issues/12674#issuecomment-2443184470, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKS7W2SPLRS2KDYBT7LEGDZ54F2DAVCNFSM6AAAAABOGZW6EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBTGE4DINBXGA . You are receiving this because you were mentioned.Message ID: @.***>

maltokyo avatar Oct 29 '24 07:10 maltokyo

Same issue here, also Pixel 8 Pro. Had it in Android 14, have it in 15. I have approx. 120.000 images in daily folder on external folders, also used that script to create albums from folders.

I noticed this: When I scroll down, the app is stuttering. Let's accept that for now and scroll BACK again. Also stuttering.

Using mobile browser instead, or on desktop computer, all is fine.

The App is excluded in DNS66 adblocker VPN.

No new photos were added for some days.

ratti avatar Oct 29 '24 11:10 ratti

Describes my situation perfectly Jörg

On Tue, Oct 29, 2024, 12:53 PM Jörg Roßdeutscher @.***> wrote:

Same issue here, also Pixel 8 Pro. Had it in Android 14, have it in 15. I have approx. 120.000 images in daily folder on external folders, also used that script to create albums from folders.

I noticed this: When I scroll down, the app is stuttering. Let's accept that for now and scroll BACK again. Also stuttering.

Using mobile browser instead, or on desktop computer, all is fine.

The App is excluded in DNS66 adblocker VPN.

No new photos were added for some days.

— Reply to this email directly, view it on GitHub https://github.com/immich-app/immich/issues/12674#issuecomment-2444001060, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKS7W4IOCW22AMF2BGWDYDZ55ZLFAVCNFSM6AAAAABOGZW6EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBUGAYDCMBWGA . You are receiving this because you were mentioned.Message ID: @.***>

maltokyo avatar Oct 29 '24 14:10 maltokyo

@Cookie-Monster-Coder hmmm, what is your phone model? If you go to App Settings > Advanced > toggle Prefer Remote Image, does it help?

Samsung 22+

Enabling Remote Images does NOT help.

Cookie-Monster-Coder avatar Oct 29 '24 14:10 Cookie-Monster-Coder

Hmm, this is very odd; I tested my 80_000 assets library on a Pixel 8 and Galaxy 23 and cannot cause it to crash or stutter after the assets and album are synced. There is some janking when the bucket is loaded in. I wonder if there is some specific photo that the app cannot read and cause the crash 🤔

alextran1502 avatar Oct 29 '24 15:10 alextran1502

Could it be that I'm using an external script to create albums from each folder in the external library? That has created 1000s of albums.

On Tue, Oct 29, 2024, 4:08 PM Alex @.***> wrote:

Hmm, this is very odd; I tested my 80_000 assets library on a Pixel 8 and Galaxy 23 and cannot cause it to crash or stutter after the assets and album are synced. I wonder if there is some specific photo that the app cannot read and cause the crash 🤔

— Reply to this email directly, view it on GitHub https://github.com/immich-app/immich/issues/12674#issuecomment-2444548487, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKS7W6FBGOQNTPBNEFTFWTZ56QIJAVCNFSM6AAAAABOGZW6EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBUGU2DQNBYG4 . You are receiving this because you were mentioned.Message ID: @.***>

maltokyo avatar Oct 29 '24 15:10 maltokyo

@maltokyo Yep, that will do it for your case. Until the new album sync is implemented, it is not pretty for 1000s albums at the moment

alextran1502 avatar Oct 29 '24 15:10 alextran1502

Though it's interesting that it occurs also on the photos screen, where no album info is shown at all.

On Tue, Oct 29, 2024, 4:12 PM Alex @.***> wrote:

@maltokyo https://github.com/maltokyo Yep, that will do it for your case. Until the new album sync is implemented, it is not pretty for 1000s albums at the moment

— Reply to this email directly, view it on GitHub https://github.com/immich-app/immich/issues/12674#issuecomment-2444556906, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKS7W34BXDITDOZGUWFPZTZ56QUDAVCNFSM6AAAAABOGZW6EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBUGU2TMOJQGY . You are receiving this because you were mentioned.Message ID: @.***>

maltokyo avatar Oct 29 '24 15:10 maltokyo

@maltokyo The current album sync process is running on the main thread due to its complexity and causing the UI to stutter

alextran1502 avatar Oct 29 '24 15:10 alextran1502

Ok, thanks for the clarification. Makes sense. If somehow I can delete all albums and try without them, happy to give it a try. Just not sure how to delete 1000s albums.

On Tue, Oct 29, 2024, 4:22 PM Alex @.***> wrote:

@maltokyo https://github.com/maltokyo The current album sync process is running on the main thread due to its complexity and causing the UI to stutter

— Reply to this email directly, view it on GitHub https://github.com/immich-app/immich/issues/12674#issuecomment-2444586639, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKS7W7ROAC7ERDPRQ4OX6TZ56R3LAVCNFSM6AAAAABOGZW6EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBUGU4DMNRTHE . You are receiving this because you were mentioned.Message ID: @.***>

maltokyo avatar Oct 29 '24 15:10 maltokyo