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

Feat: remove loop reduction & filter unnecessary apprev update #5598

Merged
merged 3 commits into from
Mar 3, 2023

Conversation

Somefive
Copy link
Collaborator

@Somefive Somefive commented Mar 3, 2023

Description of your changes

Add two optimization:

  1. Remove loop-reduction optimization and let it be enabled by default. This is because the workflow state transition has changed its mechanism and if we do not enable loop reduction by default, the application will run twice gc every reconcile.
  2. The application revision updates always runs no matter whether it is needed. However, usually, the application revision do not change when state-keep-oriented reconcile happens. This PR reduct it to optimize performance.

Result:
image
Optimization 1 can reduce the reconcile time from 125ms to 96ms, increase 23% performance for state-keep-oriented reconcile under simple application delivery scenario.
image
Optimization 2 can reduce the reconcile time from 96ms to 70ms, increase 27% performance for state-keep oriented reconcile under simple application delivery scenario.

I have:

  • Read and followed KubeVela's contribution process.
  • Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Special notes for your reviewer

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -4.02 ⚠️

Comparison is base (0d27a41) 61.55% compared to head (209f1cb) 57.53%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5598      +/-   ##
==========================================
- Coverage   61.55%   57.53%   -4.02%     
==========================================
  Files         311      311              
  Lines       48021    48018       -3     
==========================================
- Hits        29557    27629    -1928     
- Misses      15406    17503    +2097     
+ Partials     3058     2886     -172     
Flag Coverage Δ
apiserver-e2etests 35.79% <100.00%> (-0.05%) ⬇️
apiserver-unittests ?
core-unittests 55.71% <100.00%> (+<0.01%) ⬆️
e2e-multicluster-test 18.85% <100.00%> (-0.10%) ⬇️
e2e-rollout-tests 21.51% <100.00%> (-0.04%) ⬇️
e2etests 27.24% <100.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/controller/flags.go 100.00% <ø> (ø)
...dev/v1alpha2/application/application_controller.go 84.13% <100.00%> (-2.46%) ⬇️
...ller/core.oam.dev/v1alpha2/application/revision.go 71.10% <100.00%> (-0.71%) ⬇️
pkg/apiserver/domain/service/tags.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/apiserver/utils/dex.go 0.00% <0.00%> (-72.73%) ⬇️
pkg/apiserver/domain/service/webhook.go 5.30% <0.00%> (-61.18%) ⬇️
pkg/apiserver/domain/service/cloudshell.go 1.43% <0.00%> (-61.16%) ⬇️
...server/infrastructure/datastore/mongodb/mongodb.go 0.00% <0.00%> (-60.37%) ⬇️
pkg/apiserver/event/collect/system_info_collect.go 5.52% <0.00%> (-58.07%) ⬇️
pkg/apiserver/domain/service/util.go 41.17% <0.00%> (-47.06%) ⬇️
... and 44 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -856,6 +856,9 @@ func (h *AppHandler) FinalizeAndApplyAppRevision(ctx context.Context) error {
}
return err
}
if apiequality.Semantic.DeepEqual(gotAppRev.Spec, appRev.Spec) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please also compare the annotations and labels from metadata

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
@Somefive Somefive mentioned this pull request Mar 3, 2023
4 tasks
@Somefive Somefive merged commit 76a8d13 into kubevela:master Mar 3, 2023
@Somefive Somefive deleted the feat/remove-loop-reduction branch June 20, 2023 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants