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

People: Entering names becomes slow with many faces tagged #3151

Closed
sporto opened this issue Jan 30, 2023 · 8 comments · Fixed by #3233
Closed

People: Entering names becomes slow with many faces tagged #3151

sporto opened this issue Jan 30, 2023 · 8 comments · Fixed by #3233
Assignees
Labels
performance Performance Optimization released Available in the stable release ux Impacts User Experience

Comments

@sporto
Copy link

sporto commented Jan 30, 2023

1. What is not working as documented?

I scanned my photo library and ended up with about 400 faces to tag.
I noted that the face tagging UI gets very sluggish sometimes. i.e. typing a letter doesn't show anything in the page for a few seconds. This seems to happen only when editing a name already added.

2. How can we reproduce it?

  • Import lots of faces
  • Go to People > New
  • Tag one person and press enter
  • Try to edit that same person name
  • The edits take a long time to reflect on the page

3. What behavior do you expect?

For inputs to reflect immediatelly on the page while typing

4. What could be the cause of your problem?

Maybe the rendering framework not being able to keep up with the input changes and the amount of faces to display

5. Can you provide us with example files for testing, error logs, or screenshots?

screencast.2023-01-30.20-07-17.mp4

It is not super obvious in the recording, but I type backspace several times and don't see a change for several seconds. Then the change appears suddenly.

6. Which software versions do you use?

(a) PhotoPrism Architecture & Build Number:
Intel
Build 221118-e58fee0fb

(b) Database Type & Version: MariaDB

(c) Operating System Types & Versions: Linux PopOS 22.04

(d) Browser Types & Versions: Firefox 108

7. On what kind of device is PhotoPrism installed?

(a) Device / Processor Type: Intel Nuc i5

(b) Physical Memory & Swap Space in GB: 16GB

(c) Storage Type: HDD 240GB.

8. Do you use a Reverse Proxy, Firewall, VPN, or CDN?

No

@sporto sporto added the bug Something isn't working label Jan 30, 2023
@lastzero
Copy link
Member

It could be a websockets issue (even though no proxy is used) or the backend is slow (SSD is recommended), so it takes a bit for the changes (e.g. new names) to be pushed to the frontend. "Immediately" is generally not possible if you work with asynchronous systems and don't want to block the user interface.

@lastzero lastzero added needs-analysis Requires further investigation help wanted Well suited for external contributors! ux Impacts User Experience and removed bug Something isn't working labels Jan 30, 2023
@ronhaley48
Copy link

ronhaley48 commented Feb 22, 2023

I had the same issue, times > 45 seconds. It improved vastly when I expanded the static size limit to 7680 px. That may have been coincidental. Running on I5-11400, Unraid docker. 16K photos in search, 40K in Originals.

@lastzero
Copy link
Member

It is not super obvious in the recording, but I type backspace several times and don't see a change for several seconds. Then the change appears suddenly.

@sporto Thanks a lot for the video! I've only seen it now and it was very helpful.

This could be due to the "search as you type" functionality, although I can't notice this when testing on our demo with Chrome or Firefox 110.

I scanned my photo library and ended up with about 400 faces to tag.

Is it 400 names/people or just 400 face clusters with only a few different names? How many names in total?

If you have a long list of names, I would think the problem is caused by the search function. With a little luck, @heikomat has time to look at it. He's really good when it comes to optimizing UI performance.

@lastzero lastzero added the performance Performance Optimization label Feb 22, 2023
@lastzero lastzero changed the title Sluggish UI when tagging people People: Entering names becomes slow when many faces are tagged Feb 22, 2023
@lastzero lastzero changed the title People: Entering names becomes slow when many faces are tagged People: Entering names becomes slow with many faces tagged Feb 22, 2023
@heikomat
Copy link
Sponsor Contributor

I'll see if I can have a look at this on the weekend. As always though: no promises

IF the problem is render performance when filtering, then the usual approach for this is to only update the search when the filter hasn't changed for like 200-500ms
This works best if a single rerender itself doesnt take too long. So i could

  1. Look at the render performance there in general
  2. Debounce the search input

@sporto
Copy link
Author

sporto commented Feb 25, 2023

Is it 400 names/people or just 400 face clusters with only a few different names? How many names in total?

Unsure what you mean, there are like 400 people to tag. Some are duplicates that the system think are different people.
I tagged just a few, about 30. So I only have these many names in the search as you type.

The field is very responsive when tagging a new face. It is only sluggish when editing the name after already tagged the first time.

@heikomat
Copy link
Sponsor Contributor

looking into it tonight :)

@heikomat
Copy link
Sponsor Contributor

While it doesn't speed up the rendering of the faces-page, this fix makes it so that the faces-page is not rerendered on every typed letter, so editing new names is no longer tedious with a lot of new faces.

@lastzero
Copy link
Member

This is now available for testing in our development preview and demo!

@lastzero lastzero added please-test Ready for acceptance test and removed help wanted Well suited for external contributors! needs-analysis Requires further investigation labels Feb 27, 2023
@graciousgrey graciousgrey added tested Changes have been tested successfully and removed please-test Ready for acceptance test labels Apr 25, 2023
@graciousgrey graciousgrey added released Available in the stable release and removed tested Changes have been tested successfully labels May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance Optimization released Available in the stable release ux Impacts User Experience
Projects
Status: Release 🌈
Development

Successfully merging a pull request may close this issue.

5 participants