Skip to content

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

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