-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(kubernetes): Reduce memory allocation during caching cycles (#3736)
* perf(kubernetes): Reduce memory allocation during caching cycles The caching logic for the kubernetes v2 provider allocates a lot of short-term memory during each caching cycle, putting pressure on the garbage collector, in some cases exceeding the garbage collection overhead. A significant contributor is the logic to compute relationships between kubernetes objects. We currently create a CacheData object to hold each relationship and rely on downstream (and inefficient) logic to merge these into one CacheData per object, containing all of its relationships. Improve this by having invertRelationships return one CacheData per object (containing all of its relationships) rather than on CacheData per relationship. Likewise, have getClusterRelationships return a single CacheData for each application, rather than a separate one for each application-object relationship. * test(kubernetes): Add tests to getClusterRelationships Also simplify the logic in the invertRelationships test
- Loading branch information
Showing
4 changed files
with
114 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters