-
Notifications
You must be signed in to change notification settings - Fork 468
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
gwctl performance improvements #3145
gwctl performance improvements #3145
Conversation
Eg. When we have a set of HTTPRoutes and we want to fetch all Backends referenced by this HTTPRoute, it's slightly better to fetch all the Backends with one API call and then filter these out based on which are being referenced. This is in contrast with fetching each individual backend through a separate API call that is referenced by the HTTPRoutes. (Even at smaller scales, multiple API calls starts to seem inefficient)
Events associated with a resource need to be fetch independently for each resource. This means the number of API calls grows linearly with the number of resources that we have. - Pre-fetching events for all resources BEFORE PRINTING ANYTHING gives the impression of the CLI being unresponsive. - Lazily fetching events allows us to print the describe-view for a single resource fully before fetching events for the next one, thereby giving the user an impression of the CLI making progress. Also, it makes sense for Events to not be part of the ResourceModel given events are just tied with a single resource and have no interdependence (so don't need some pre-calculations)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, thanks @gauravkghildiyal!
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gauravkghildiyal, mlavacca The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* Fetch resources in bulk instead of single API calls as the default. Eg. When we have a set of HTTPRoutes and we want to fetch all Backends referenced by this HTTPRoute, it's slightly better to fetch all the Backends with one API call and then filter these out based on which are being referenced. This is in contrast with fetching each individual backend through a separate API call that is referenced by the HTTPRoutes. (Even at smaller scales, multiple API calls starts to seem inefficient) * Lazily fetch events instead of making them part of the ResourceModel. Events associated with a resource need to be fetch independently for each resource. This means the number of API calls grows linearly with the number of resources that we have. - Pre-fetching events for all resources BEFORE PRINTING ANYTHING gives the impression of the CLI being unresponsive. - Lazily fetching events allows us to print the describe-view for a single resource fully before fetching events for the next one, thereby giving the user an impression of the CLI making progress. Also, it makes sense for Events to not be part of the ResourceModel given events are just tied with a single resource and have no interdependence (so don't need some pre-calculations)
* Fetch resources in bulk instead of single API calls as the default. Eg. When we have a set of HTTPRoutes and we want to fetch all Backends referenced by this HTTPRoute, it's slightly better to fetch all the Backends with one API call and then filter these out based on which are being referenced. This is in contrast with fetching each individual backend through a separate API call that is referenced by the HTTPRoutes. (Even at smaller scales, multiple API calls starts to seem inefficient) * Lazily fetch events instead of making them part of the ResourceModel. Events associated with a resource need to be fetch independently for each resource. This means the number of API calls grows linearly with the number of resources that we have. - Pre-fetching events for all resources BEFORE PRINTING ANYTHING gives the impression of the CLI being unresponsive. - Lazily fetching events allows us to print the describe-view for a single resource fully before fetching events for the next one, thereby giving the user an impression of the CLI making progress. Also, it makes sense for Events to not be part of the ResourceModel given events are just tied with a single resource and have no interdependence (so don't need some pre-calculations)
What type of PR is this?
/kind feature
What this PR does / why we need it:
Summary of changes (details available in commit logs):
Prioritize fetching resources in bulk rather than individually to reduce API call overhead. (Some simple performance tests with large number of resources indicated this provides the better overall UX)
Fetch events associated with resources on-demand when printing, enhancing responsiveness and minimizing unnecessary API calls (since events are not required in GET output)
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?:
/assign @mlavacca