Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add -cache-dbpath option to scan subcommand.
The default path of -cache-dbpath is $PWD/cache.db
Changelog cache
Vuls parses changelogs of updatable packages in the case of a target server is Ubuntu/Debian.
To get the changelog, Vuls issue apt-get changelog for each updatable packages.
Scan speed on Ubuntu/Debian was slow because apt-get changelog is slow.
So I decided to use boltdb for caching changelogs of updatable packages.
botldb: https://github.com/boltdb/bolt
apt-get policy
apt-get policy is a slow operation.
Previously Vuls issues
apt-cache policy
for each updatable package.Now Vuls issues the command only once.
Scan time
20 TIMES FASTER on Ubuntu16.04
On Ubuntu 16.04 server that has 95 updatable packages.
Before ... 3min10s
After(1st) ... 1min50s (without local cache)
After(2nd) ... 10s (with local cache)
4 TIMES FASTER on Debian8
On Debian8 server that has 34 updatable packages.
Before ... 5min
After(1st) ... 3m40s (without local cache)
After (2nd) ... 1m20s (with local cahce)