-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
performance: Alter makeResIds.go's PrevIds to use a targeted APIVersion retrieval #4793
Comments
/triage accepted |
Quick status update... Currently I'm working through our process to get clearance for submissions. As I've poked around a bit, I've been able to find some more opportunities for improvement. Here's my cumulative working patch: There are a few things going on in this combined patch, with the big one being the ability to limit the fields traversed by RNode.Fields(). That then enables PrevIds to limit its annotation retrieval to only the annotations that it needs, which in turn causes a significant decrease in what has to be built for the call. That means less processing time and fewer allocations. There's still a lot of time spent in garbage collection. With or without the patch, my runs usually are spending 25% to 35% of their time handling gc. At the moment I'm just hacking to see what I can do. Admittedly, I don't know whether this coding pattern is one that fits kustomize's standards. My approach was to make a call chain variadic, which allows for the field retrieval limits to pass through without changing existing behavior. @natasha41575, if you think I'm heading in the wrong direction here, please let me know. I've got three test cases I've been using for figuring where to focus. One (ds) is a moderately sized and has a somewhat simple set of kustomizations. One (na) is very large and has a complex set of kustomizations. One (ro) is a large set of resources, with no kustomizations - it's just a resource load. Using go's profiling tools, here's how things look with this patch: ds-cpu-current.svg: Showing nodes accounting for 11.35s, 58.03% of 19.56s total na-cpu-current.svg: Showing nodes accounting for 244.69s, 73.59% of 332.52s total ro-cpu-current.svg: Showing nodes accounting for 43.18s, 81.63% of 52.90s total |
I realized it'd be best to keep the PR for this issue specific to what the issue describes. I'll pursue the other fixes separately. |
Currently makeResIds.go's PrevIds retrieves the APIVersion by calling GetMeta. However, the only content that is used is the APIVersion. GetMeta is a lot heavier than GetApiVersion, and converting yields a meaningful performance improvement in moderately complex runs.
I'm planning to handle this one myself, since I'd like to use it as a working example to become a contributor.
/assign
Current code:
Proposed change:
Comparison analysis
Note that these builds are leveraging the proposed fix in #4790.
Platform
linux
The text was updated successfully, but these errors were encountered: