Skip to content

fix(web): Speed up lookups on large datasets#26876

Closed
ghost wants to merge 5 commits intomainfrom
unknown repository
Closed

fix(web): Speed up lookups on large datasets#26876
ghost wants to merge 5 commits intomainfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Mar 12, 2026

Description

Fixes: #4180

How Has This Been Tested?

time parsing library caching + o(1) instead of .find

  • Test A
  • Test B

Checklist:

  • I have carefully read CONTRIBUTING.md
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

initial pr for
#4180

@ghost ghost requested a review from danieldietzler as a code owner March 12, 2026 14:05
@immich-push-o-matic
Copy link

immich-push-o-matic bot commented Mar 12, 2026

Label error. Requires exactly 1 of: changelog:.*. Found: 🖥️web. A maintainer will add the required label.

@ghost ghost changed the title Speed up lookups on large datasets fix: Speed up lookups on large datasets Mar 12, 2026
@alextran1502
Copy link
Member

Can you show some benchmarking on small/medium/large libraries? Otherwise we won't be able to justify the changes to have it merged

@ghost ghost changed the title fix: Speed up lookups on large datasets fix(web): Speed up lookups on large datasets Mar 12, 2026
@ghost
Copy link
Author

ghost commented Mar 12, 2026

Can you show some benchmarking on small/medium/large libraries? Otherwise we won't be able to justify the changes to have it merged

upd: was thinking of time related caching while typing this:

i have done it, on large datasets 1-20ms vs 1000+ ms.
small ones will be similar, medium will be following the large datasets scenario, should be kinda obvious considering the callbacks speed in js engines

image

its basically the same little unnoticeable bottleneck you were describing in your PR related to casting and casting taking 1 second

@ghost ghost requested a review from michelheusschen March 12, 2026 15:46
@ghost ghost closed this Mar 12, 2026
@ghost
Copy link
Author

ghost commented Mar 12, 2026

string allocation slows down entire thing

@ghost
Copy link
Author

ghost commented Mar 12, 2026

can be fixed with any fast hashing algorithm but since i cant find any usage of any kind of hashing function in codebase yet id rather close, but keep in mind its a second still

image image

@ghost ghost reopened this Mar 12, 2026
@ghost ghost closed this Mar 12, 2026
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Web client has major performance issues with large image library

2 participants