What you would like to be added?
When controllerutil.CreateOrPatch is invoked it calls the following:
objPatch := client.MergeFrom(obj.DeepCopyObject().(client.Object))
statusPatch := client.MergeFrom(obj.DeepCopyObject().(client.Object))
It then converts the objects to unstructure.Unstructured and does a nested field copy
before, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj.DeepCopyObject())
if err != nil {
return OperationResultNone, err
}
// Attempt to extract the status from the resource for easier comparison later
beforeStatus, hasBeforeStatus, err := unstructured.NestedFieldCopy(before, "status")
if err != nil {
return OperationResultNone, err
}
Other expensive calls are reflect.DeepEqual(before, after) as well. Need to investigate on how to optimize this since there can be large number of invocations of this method.
Why is this needed?
Grove at scale need to handle large number of PodCliqueSet, each of which can contain multiple PodClique's. Optimizing costly operations will help ensure that the CPU consumption is kept well within limits.
What you would like to be added?
When
controllerutil.CreateOrPatchis invoked it calls the following:It then converts the objects to
unstructure.Unstructuredand does a nested field copyOther expensive calls are
reflect.DeepEqual(before, after)as well. Need to investigate on how to optimize this since there can be large number of invocations of this method.Why is this needed?
Grove at scale need to handle large number of PodCliqueSet, each of which can contain multiple PodClique's. Optimizing costly operations will help ensure that the CPU consumption is kept well within limits.