This PR has a few tweaks to consolidate string matching logic and improve performance along with some other miscellaneous changes.
On the performance side, I replaced filepath.Walk with filepath.WalkDir when recursively looking for files in a given scan path. With the code in main, scanning the Linux repository consisting of ~85,000 files took roughly ~4 minutes. With these changes, the scan takes about ~3 1/2 which is a decent improvement.
The other changes are mostly just syntax changes, though I did add a few more program kinds for the sake of completion along with a test and benchmark for longestUnique since it looks like a possible area for future optimization.
This PR has a few tweaks to consolidate string matching logic and improve performance along with some other miscellaneous changes.
On the performance side, I replaced
filepath.Walk
withfilepath.WalkDir
when recursively looking for files in a given scan path. With the code inmain
, scanning the Linux repository consisting of ~85,000 files took roughly ~4 minutes. With these changes, the scan takes about ~3 1/2 which is a decent improvement.The other changes are mostly just syntax changes, though I did add a few more program kinds for the sake of completion along with a test and benchmark for
longestUnique
since it looks like a possible area for future optimization.