Reduce memory usage (#4349)

When linting SwiftLint, this brings memory usage down by around 20%,
going from 372MB to 297MB.

This is achieved by removing the unused `RebuildQueue` and by clearing
cached data associated with files after processing them.

Depends on https://github.com/jpsim/SourceKitten/pull/749.
This commit is contained in:
JP Simard
2022-10-12 09:39:36 -04:00
committed by GitHub
parent 87e9757af2
commit 602070164b
5 changed files with 11 additions and 27 deletions
@@ -249,6 +249,9 @@ public struct CollectedLinter {
"completely removed in a future release.")
}
// Free some memory used for this file's caches. They shouldn't be needed after this point.
file.invalidateCache()
return (violations, ruleTimes)
}