When CNCF researchers profiled Kyverno's CEL (Common Expression Language) admission engine, they anticipated finding the majority of performance cost within policy evaluation itself. The heap profile revealed a different story.
According to the CNCF blog post, the ConvertObjectToUnstructured function accounted for 86.8% of allocated bytes before optimization. This function prepares objects for CEL evaluation by converting the AdmissionRequest from the API server into the unstructured map form that CEL expressions can reference. CEL policy evaluation itself barely registered in resource consumption.
The investigation began after public benchmarks showed Kyverno underperforming relative to alternatives. Those benchmarks had measured the legacy ClusterPolicy JMESPath engine, which suffered a genuine performance regression at the time. While recommending the newer CEL engine proved correct, the CNCF team discovered this guidance was incomplete—they had not profiled where the CEL engine itself allocated its resources.
After optimization, ConvertObjectToUnstructured consumption dropped to 2.9% of allocated bytes. The evaluateWithData frame, which executes actual policy expressions, became the largest resource consumer. The same pattern appeared in the MutatingPolicy engine, though with smaller absolute costs.
The performance cost growth correlated with the number of deployed policies. The fix addresses this scaling issue and ships in Kyverno 1.19.2, though the CNCF blog post does not provide specific rollout timelines or availability details.
The CNCF cautions readers to review the limitations section of their analysis before citing specific numbers and recommends running tests in production environments for real-world accuracy.
Read the original announcement for complete details and context.
Independent editorial summary based on the original announcement. Illustration is conceptual.
