perf: use UnsafeDisableDeepCopy and cache for list Unstructured Resources#7704
perf: use UnsafeDisableDeepCopy and cache for list Unstructured Resources#7704arkodg merged 2 commits intoenvoyproxy:mainfrom
Conversation
67e5523 to
0322ee5
Compare
| @@ -75,6 +76,11 @@ func New(ctx context.Context, restCfg *rest.Config, svrCfg *ec.Server, resources | |||
| HealthProbeBindAddress: healthProbeBindAddress, | |||
| LeaderElectionID: "5b9825d2.gateway.envoyproxy.io", | |||
| LeaderElectionNamespace: svrCfg.ControllerNamespace, | |||
| Client: client.Options{ | |||
There was a problem hiding this comment.
is this section needed ? or can be do with only L155-157
There was a problem hiding this comment.
I think we should set the value to true to cache the unstructured resources here
1bd6fbb to
5ee3e68
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7704 +/- ##
==========================================
- Coverage 72.82% 72.82% -0.01%
==========================================
Files 235 235
Lines 35214 35219 +5
==========================================
+ Hits 25645 25648 +3
- Misses 7752 7754 +2
Partials 1817 1817 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
befe485 to
378f26f
Compare
ec1f7c2 to
01216af
Compare
|
@fabian4 can this be scoped to only unstructured |
|
Heads up: #7626 also calls for updating the unstructured I have a small, tested diff for |
cdae018 to
fad7603
Compare
|
I tried enable UnsafeDisableDeepCopy at the cache level but cache configuration requires explicit GVK registration. // Supported Gateway API GVKs
// controller-runtime cache requires concrete GVKs.
// Unstructured caching is enabled per GVK using unstructured.Unstructured
gatewayAPIGVKs = []schema.GroupVersionKind{
{Group: "gateway.networking.k8s.io", Version: "v1beta1", Kind: "Gateway"},
}
for _, gvk := range gatewayAPIGVKs {
u := &unstructured.Unstructured{}
u.SetGroupVersionKind(gvk)
mgrOpts.Cache.ByObject[u] = cache.ByObject{
UnsafeDisableDeepCopy: ptr.To(true),
}
}So maybe we enable it at each List() call is better. Thanks @aponysus |
7c576a9 to
aac5c36
Compare
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…Resources Signed-off-by: fabian4 <fabian.v.bao@gmail.com>
…Resources Signed-off-by: fabian4 <fabian.v.bao@gmail.com>
aac5c36 to
4efefc6
Compare
…rces (envoyproxy#7704) * Performanceuse UnsafeDisableDeepCopy and cache for list Unstructured Resources Signed-off-by: fabian4 <fabian.v.bao@gmail.com>
…rces (envoyproxy#7704) * Performanceuse UnsafeDisableDeepCopy and cache for list Unstructured Resources Signed-off-by: fabian4 <fabian.v.bao@gmail.com> Signed-off-by: Sadmi Bouhafs <sadmibouhafs@gmail.com>
What type of PR is this?
perf: use UnsafeDisableDeepCopy and cache for list Unstructured Resources
What this PR does / why we need it:
use UnsafeDisableDeepCopy and cache for list Unstructured Resources
Which issue(s) this PR fixes:
Fixes #7626
Release Notes: Yes/No