Skip to content
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

perf: reduce the memory footprint of REST collector #3303

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Conversation

cgrinds
Copy link
Collaborator

@cgrinds cgrinds commented Nov 18, 2024

When the REST collector walks pagination links, it does so recursively. Each of these recursive calls retains the previous REST response on the stack, and when there are many recursive calls, a lot of memory can be used. Replace the recursive calls with iterative ones.

When the REST collector walks pagination links, it does so recursively. Each of these recursive calls retains the previous REST response on the stack, and when there are many recursive calls, a lot of memory can be used. Replace the recursive calls with iterative ones.
rahulguptajss
rahulguptajss previously approved these changes Nov 19, 2024
cmd/tools/rest/rest.go Outdated Show resolved Hide resolved
Hardikl
Hardikl previously approved these changes Nov 19, 2024
cmd/tools/rest/rest.go Show resolved Hide resolved
When the REST collector walks pagination links, it does so recursively. Each of these recursive calls retains the previous REST response on the stack, and when there are many recursive calls, a lot of memory can be used. Replace the recursive calls with iterative ones.
@cgrinds cgrinds dismissed stale reviews from Hardikl and rahulguptajss via 107fc9b November 19, 2024 12:39
@rahulguptajss rahulguptajss merged commit ef244dc into main Nov 19, 2024
8 checks passed
@rahulguptajss rahulguptajss deleted the cbg-perf branch November 19, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants