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

perf(web): optimize date groups #7593

Merged
merged 7 commits into from Mar 3, 2024
Merged

Conversation

mertalev
Copy link
Contributor

@mertalev mertalev commented Mar 3, 2024

Description

The algorithm for grouping by date is inefficient and doesn't scale well. There's also no caching, so revisiting buckets re-groups again. This PR optimizes this with a more efficient algorithm and ensures that a given bucket will only ever be grouped into dates once.

How Has This Been Tested?

Tested with a console log during grouping to check that a given bucket is only grouped once, even after scrubbing away and back to the bucket.

Copy link

cloudflare-pages bot commented Mar 3, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6b98bbd
Status: ✅  Deploy successful!
Preview URL: https://d5ac90d3.immich.pages.dev
Branch Preview URL: https://perf-web-date-group-optimiza.immich.pages.dev

View logs

@waclaw66
Copy link
Contributor

waclaw66 commented Mar 3, 2024

Does this solve issue #5030 ?

Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! :)

@mertalev
Copy link
Contributor Author

mertalev commented Mar 3, 2024

Does this solve issue #5030 ?

No, that one is because we only do a rough estimate of height initially and update as we fetch the assets. The justified layout makes it hard to get it exact. There's probably room for improvement there though.

@alextran1502 alextran1502 merged commit 762c468 into main Mar 3, 2024
26 of 27 checks passed
@alextran1502 alextran1502 deleted the perf/web-date-group-optimization branch March 3, 2024 22:12
michelheusschen added a commit that referenced this pull request Mar 5, 2024
alextran1502 pushed a commit that referenced this pull request Mar 5, 2024
Revert "perf(web): optimize date groups (#7593)"

This reverts commit 762c468.
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.

None yet

4 participants