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

Improving performance enhancement specifically during diff stage #731

Merged
merged 1 commit into from
May 23, 2023

Conversation

rohitagg2020
Copy link
Contributor

@rohitagg2020 rohitagg2020 commented Apr 3, 2023

Improving performance enhancement specifically during diff stage.

By go profiling, we have noticed that there are too many calls to deepCopy and AsYAMLBytes

Improvements done:

  1. While rebas'ing a resource, we wont do Deepcopy until the resource being rebased matches with the resource for which rebase resource is defined.
  2. default.go which was already in yaml was unnecessary being converted to struct and then back to yaml. Removed this unnecessary conversion.
  3. Reduced calls to AsYAMLBytes.

Only one breaking scenario w.r.t. changes proposed:

  1. kapp deploy (config with deployment) with v0.15.0 or earlier. Most of the times, revision is not set while storing md5. But sometimes it can. Lets move forward with scenario where it can.
  2. There has been no changes.
  3. kapp deploy (config with deployment) with these changes. In this case, the user will see the diff’s.

The chances of this scenario are extremely low…

What this PR does / why we need it:

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.:


@rohitagg2020 rohitagg2020 marked this pull request as ready for review April 6, 2023 10:09
@kumaritanushree
Copy link
Contributor

LGTM

pkg/kapp/diff/rebased_resource.go Show resolved Hide resolved
pkg/kapp/diff/change.go Show resolved Hide resolved
pkg/kapp/config/default.go Show resolved Hide resolved
pkg/kapp/diff/resource_with_history.go Outdated Show resolved Hide resolved
@rohitagg2020 rohitagg2020 force-pushed the ra-perf-enhancement-1 branch 2 times, most recently from b450d6e to 3d7729d Compare May 22, 2023 02:44
Signed-off-by: rohitagg2020 <rohit.aggarwal2020@gmail.com>
@rohitagg2020 rohitagg2020 merged commit fb481b0 into develop May 23, 2023
@praveenrewar praveenrewar deleted the ra-perf-enhancement-1 branch May 25, 2023 18:00
@renuy renuy mentioned this pull request Jun 23, 2023
12 tasks
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.

3 participants