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

Memory optimization #863

Merged
merged 4 commits into from
Jan 19, 2024
Merged

Memory optimization #863

merged 4 commits into from
Jan 19, 2024

Conversation

praveenrewar
Copy link
Member

@praveenrewar praveenrewar commented Nov 17, 2023

What this PR does / why we need it:

Optimize memory usage in the following sections:

  • Ops diff calculation
  • Rebasing
  • Text diff calculation

Tested the changes by deploying different versions of Kubernetes Prometheus stack helm chart.

Diff/No Diff Total memory allocation (Before) Total memory allocation (Now)
No diff (same version) 1368MB 814 MB
Diff (different version) 3044 MB 1305 MB

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?


Additional Notes for your reviewer:

Review Checklist:
  • Follows the developer guidelines
  • Relevant tests are added or updated
  • Relevant docs in this repo added or updated
  • Relevant carvel.dev docs added or updated in a separate PR and there's
    a link to that PR
  • Code is at least as readable and maintainable as it was before this
    change

Additional documentation e.g., Proposal, usage docs, etc.:


@praveenrewar praveenrewar changed the title Optimise ops diff Memory optimization Nov 21, 2023
if the resources are already getting deep copied later on

Signed-off-by: Praveen Rewar <[email protected]>
Only copy them when required

Signed-off-by: Praveen Rewar <[email protected]>
Signed-off-by: Praveen Rewar <[email protected]>
Add --diff-anchored flag

Signed-off-by: Praveen Rewar <[email protected]>
@praveenrewar praveenrewar marked this pull request as ready for review January 18, 2024 09:37
Copy link
Contributor

@100mik 100mik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thanks for calling out the difference in the tests 🙏🏼

@praveenrewar praveenrewar merged commit 90412c7 into develop Jan 19, 2024
5 checks passed
@praveenrewar praveenrewar deleted the memory-optimisation branch January 19, 2024 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants