Skip to content

Computation of PodTemplateSpec has is CPU intensive #406

@unmarshall

Description

@unmarshall

What happened?

Context: operator/internal/controller/common/component/utils.ComputePCLQPodTemplateHash

Hash is computed using:

fmt.Fprintf(podTemplateSpecHasher, "%v", dump.ForHash(podTemplateSpec))

which converts the entire PodTemplateSpec to unstructured format using deep reflection. This is called every time in getLabels() during reconciliation, even when the template hasn't changed. This adds significant load on CPU resource and even does re-computation when it can be completely avoided.

What did you expect to happen?

Hash computation should only happen when something has changed in the fields that are used to compute the hash.

Environment

  • Grove version: Since v0.1.0-alpha.1

Metadata

Metadata

Assignees

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