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

chore: shrink listing file to speed download times #347

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

willmurphyscode
Copy link
Contributor

The listing file is large enough and frequently enough downloaded that we expect better performance with a smaller listing database file.

See anchore/grype#1731

The listing file is large enough and frequently enough downloaded that
we expect better performance with a smaller listing database file.

Signed-off-by: Will Murphy <[email protected]>
@@ -17,8 +17,8 @@
from collections.abc import Generator

DB_SUFFIXES = {".tar.gz", ".tar.zst"}
MAX_DB_AGE = 120 # ~4 months in days
MINIMUM_DB_COUNT = MAX_DB_AGE # number of db entries per schema
MAX_DB_AGE = 7 # old db listings are making the file large and slowing download times
Copy link
Contributor

Choose a reason for hiding this comment

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

My vote is to make this 2, which would support what I think are the main use cases:

  • get the latest
  • see what's changed in the latest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. I'll do that and also figure out why unit tests are failing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went with 3 because it prevents having to rewrite a test fixture. Do you think it's important to push for 2 @kzantow?

@willmurphyscode willmurphyscode self-assigned this Aug 5, 2024
@willmurphyscode willmurphyscode merged commit f57a24a into main Aug 5, 2024
14 checks passed
@willmurphyscode willmurphyscode deleted the chore-shorter-listing-file branch August 5, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants