-
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): Store Kind on the KubernetesManifest object (#3853)
* perf(kubernetes): Use null instead of optional We create a lot of ScopedKind objects to look up kinds, so the cost of creating an Optional each time is non-negligible. In general using Optional can be more readable than null but in this case we'd rather the performance of null (and it's just as easy to read here). * perf(kubernetes): Store Kind on the KubernetesManifest object In processing manifests, we call getKind() multiple times per manifest. It's not a cheap accessor as it needs to look up kinds in the kind registry. While recent changes have made looking up kinds a lot more efficient, it still doesn't make sense to re-do this work multiple times per manifest. Compute the kind on-demand and store it on the object; clear the cached value if we change either the kind or api group on the manifest.
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
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