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

Optimize image deletion #278

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

jue-henry
Copy link
Contributor

No description provided.

@jue-henry jue-henry self-assigned this Nov 13, 2024
@jue-henry
Copy link
Contributor Author

jue-henry commented Nov 14, 2024

Preliminary timing results after commit 4c697c7, makes all s3 image deletions in one call

log-events-viewer-result (1).csv

Avg total deletion per 100 images: 1.635 seconds
Avg mongo deletion per 100 images: 0.8332 seconds
Avg s3 deletion per 100 images: 0.802 seconds

@jue-henry
Copy link
Contributor Author

Test results after commit 1fc07bb, moves all mongo record deletions to 1 call for each collecton:

log-events-viewer-result (2).csv

Avg total deletion per 100 images: 0.877 seconds
Avg mongo deletion per 100 images: 0.1506 seconds
Avg s3 deletion per 100 images: 0.7264 seconds


const keys: { Key: string }[] = [];
console.time('delete-images s3 records');
images!.forEach((image) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So kinda stuck on this bit. Should we only delete images that we can find mongo records for or should we just delete all images that were inputted by the user?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant