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

Addresses issue 193 #205

Merged
merged 28 commits into from
Sep 16, 2023
Merged

Addresses issue 193 #205

merged 28 commits into from
Sep 16, 2023

Conversation

pmonks
Copy link
Collaborator

@pmonks pmonks commented Sep 15, 2023

This PR addresses issue #193 by adding a configurable download cache to the library, and updating org.spdx.storage.listedlicense.SpdxListedLicenseWebStore to use that cache. This new cache is disabled by default.

Note that this PR also adds a test-only log4j2-test.xml file to the test resources of the project, but for some reason it doesn't seem to be getting picked up. After some thought I came to the conclusion that it's probably worth leaving this file in the source code as a visible reminder that it would be great to get to the bottom of that.

Note:

  • to test the library with the cache enabled, the command is: mvn -Dorg.spdx.storage.listedlicense.enableCache=true test

…heckIntervalSecs for even better control over the cache
@pmonks
Copy link
Collaborator Author

pmonks commented Sep 15, 2023

In my testing locally (on a 4yo MacBook Pro), when the cache is enabled and the entire SPDX listed license & exception corpus is accessed, ~620 files totaling ~20MB are stored in the cache. There are the same number of metadata JSON files written, though they are much smaller (~2MB in total).

Once the cache is fully populated, the time the library spent loading the corpus went from ~4 minutes to ~1 second.

Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

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

Changes look good

thanks @pmonks

@goneall goneall merged commit 150b5e2 into spdx:master Sep 16, 2023
1 check passed
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.

2 participants