Skip to content

Comparator is unnecessarily resource intensive #494

@mdbooth

Description

@mdbooth

The comparator gets the schema for an object's GroupVersion on every reconcile:
https://github.com/openshift-cloud-team/boxcutter/blob/c0d5c889bc4c068e315cda223c5d5bf1d3c62fee/machinery/comparator.go#L200

It then has to parse it before using it in the comparator. Most of these will be from a small number of GroupVersions. For example, in my test set of 84 CAPI objects there are only 5 GroupVersions. There is no caching afaict, so each GV's schema is re-fetched and re-parsed many times per reconcile.

Even worse, the interaction of server-side defaulting with atomic structs and lists means that the comparator frequently returns Modified when the object hasn't actually been modified, meaning that the redundant SSA it is trying to avoid happens anyway.

The performance impact of this doesn't appear to be too awful in practice, but it's probably not good for the environment. Would be nice to improve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions