mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user