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): asset delete #7555

Merged
merged 3 commits into from Mar 2, 2024
Merged

perf(web): asset delete #7555

merged 3 commits into from Mar 2, 2024

Conversation

michelheusschen
Copy link
Contributor

The server batches asset deletes, however on the web every delete action is done individually causing performance issues when deleting a large amount of assets. The main change is removing AssetStore.removeAsset in favor of a batched variant. Previously deleting a bucket with 10_000 assets took about 4 seconds for just updating the asset store, now it's down to 3-5 milliseconds.

Copy link

cloudflare-pages bot commented Mar 1, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: a22a0c9
Status: ✅  Deploy successful!
Preview URL: https://785cbdff.immich.pages.dev
Branch Preview URL: https://perf-web-asset-delete.immich.pages.dev

View logs

@danieldietzler
Copy link
Member

Can't we just pass assetStore.removeAssets everywhere instead of (assetIds) => assetStore.removeAssets(assetIds)?

@michelheusschen
Copy link
Contributor Author

Can't we just pass assetStore.removeAssets everywhere instead of (assetIds) => assetStore.removeAssets(assetIds)?

No, the value of this changes depending on how the function is called

@jrasm91 jrasm91 merged commit a4e6c43 into main Mar 2, 2024
25 checks passed
@jrasm91 jrasm91 deleted the perf/web-asset-delete branch March 2, 2024 00:49
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

3 participants