You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -728,58 +728,53 @@ With all of this we can pass the CEL program to the TableConvertor's `ConvertToT
728
728
729
729
### CEL vs JSONPath Performance Analysis
730
730
731
-
A big part of the discussions for our proposal was the CEL cost limits since this is the first time CEL is added to the read path. As part of this we've done some benchmarking of the time it takes to parse and compile equivalent JSONPath and CEL expressions.
732
-
733
-
For the performance analysis, we introduced two new benchmark tests to the `tableconvertor_test.go` file – `Benchmark_CEL` and `Benchmark_JSONPath`.
734
-
735
-
Please find the raw output of the benchmark tests, as well as the code for executing them in the following gist:
|**Column Definition**|`self.spec.servers.map(s, s.hosts.filter(h, h == "prod.example.com"))`|`.spec.servers[*].hosts[?(@ == "prod.example.com")]`|
773
-
|**Overall Performance**<br>(Compilation + Evaluation) | • Average iterations: 3,111 <br> • Average time per operation: **382,914 ns/op** (~383 µs per op) <br> • Standard deviation: ±42,087 ns (±11%) | • Average iterations: 70,542 iterations <br> • Average time per operation: **17,654 ns/op** (~17.7 µs per op) <br> • Standard deviation: ±2,846 ns (±16%) |
A big part of the discussions for our proposal was the CEL cost limits since this is the first time CEL is added to the read path. As part of this we've done benchmarking of the time it takes to parse and compile equivalent JSONPath and CEL expressions.
732
+
733
+
> **Note**: The following benchmark analysis statistics are only indicative of the performance. The actual numbers may vary across different runs of the same test.
734
+
735
+
Refer:
736
+
-[Source code for the POC](https://github.com/sreeram-venkitesh/kubernetes/commits/kep-4595-poc/?since=2025-07-20&until=2025-07-22&author=sreeram-venkitesh)
<p>Run on Apple M3 Pro with 12 cores, 18 GB RAM, arm64</p>
742
+
<p>Find the raw output of the benchmark tests, as well as the source code: https://gist.github.com/sreeram-venkitesh/f4aff1ae7957a5a3b9c6c53e869b7403</p>
743
+
<p>The following table provides an average performance analysis across CEL and JSONPath based additionalPrinterColumns:</p>
744
+
745
+
| | CEL ([BenchmarkNew_CEL](https://gist.github.com/sreeram-venkitesh/f4aff1ae7957a5a3b9c6c53e869b7403#file-tableconvertor_test-go-L36-L75)) | JSONPath ([BenchmarkNew_JSONPath](https://gist.github.com/sreeram-venkitesh/f4aff1ae7957a5a3b9c6c53e869b7403#file-tableconvertor_test-go-L77-L116)) |
| **Overall Performance**<br>(Compilation + Evaluation) | • Average iterations: 3,111 <br> • Average time per operation: **382,914 ns/op** (~383 µs per op) <br> • Standard deviation: ±42,087 ns (±11%) | • Average iterations: 70,542 iterations <br> • Average time per operation: **17,654 ns/op** (~17.7 µs per op) <br> • Standard deviation: ±2,846 ns (±16%) |
Based on the review comment [here](https://github.com/kubernetes/enhancements/pull/4602#discussion_r2121919813) - `Benchmark an expensive JSON Path additionalPrinterColumns operation (just the part that finds a value using the JSON Path library)`.
756
+
<details>
757
+
<summary>Details</summary>
758
+
<br/>
759
+
<p>Run on a resource constraint VM - 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz, 4 CPU, 4GB RAM, X86_64</p>
760
+
<p>Find the raw output of the benchmark tests, as well as the source code: https://gist.github.com/Priyankasaggu11929/43cc9ece4d6215ee4cfe0d1523a919d6</p>
761
+
<p>The following table provides an average performance analysis across CEL and JSONPath based additionalPrinterColumns (only for the `findResults()` execution durations across the benchmark test iterations, along with the min, max, avg indexes):</p>
762
+
763
+
| | CEL ([BenchmarkNew_CEL_DeepComplex](https://gist.github.com/Priyankasaggu11929/43cc9ece4d6215ee4cfe0d1523a919d6#file-tableconvertor_testgo)) | JSONPath ([BenchmarkNew_JSONPath_DeepComplex](https://gist.github.com/Priyankasaggu11929/43cc9ece4d6215ee4cfe0d1523a919d6#file-tableconvertor_testgo)) |
_**Conclusion**_ — Across the 10 runs of the benchmark tests, on average, CEL is 20x slower than JSONPath (383µs vs 18µs).
772
+
Overall performance (compilation + evaluation + cost calculation et.al) of CEL across our two scenarios above, is that CEL is about 20x slower than JSONPath.
779
773
780
-
When running the benchmark tests individually, we observed that CEL was consistently ~20-50x slower than JSONPath.
774
+
But since our focus for the performance analysis was to analyze the **evaluation cost** (refer scenario 2):
781
775
782
-
Based on these current findings, the end users should not find a noticeable difference in the performance when working with CEL for additionalPrinterColumns.
776
+
- On average, CEL is about 7x slower than JSONPath (58.38 µs vs 8.40 µs)
777
+
- In the worst cases scenario (most expensive run) CEL is 1.5x slower than JSONPath (1870.87 µs vs 1147.24 µs)
783
778
784
779
<!--
785
780
@@ -893,72 +888,10 @@ We will test all cases in integration test and unit test. If needed, we can add
893
888
894
889
### Graduation Criteria
895
890
896
-
<!--
897
-
**Note:** *Not required until targeted at a release.*
898
-
899
-
Define graduation milestones.
900
-
901
-
These may be defined in terms of API maturity, [feature gate] graduations, or as
902
-
something else. The KEP should keep this high-level with a focus on what
903
-
signals will be looked at to determine graduation.
904
-
905
-
Consider the following in developing the graduation criteria for this enhancement:
- Announce deprecation and support policy of the existing flag
953
-
- Two versions passed since introducing the functionality that deprecates the flag (to address version skew)
954
-
- Address feedback on usage/changed behavior, provided on GitHub issues
955
-
- Deprecate the flag
956
-
-->
957
-
958
891
#### Alpha
959
892
960
893
- Feature implemented behind a feature flag
961
-
- Initial benchmarks to compare performance of JSONPath with CEL columns and set an appropriate CEL cost
894
+
- Initial benchmarks to compare performance of JSONPath with CEL columns and set an appropriate CEL cost (equivalent or at most 2x to the JSONPath cost - as discussed in the [June 11, 2025 SIG API Machinery meeting](https://docs.google.com/document/d/1x9RNaaysyO0gXHIr1y50QFbiL1x8OWnk2v3XnrdkT5Y/edit?tab=t.0#bookmark=id.epfys7yzizcn))
962
895
- Unit tests and integration tests completed and enabled
0 commit comments