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

Optimize CIDR aggregation to improve performance and reduce memory usage #7201

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

zarvd
Copy link
Contributor

@zarvd zarvd commented Oct 5, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Optimize CIDR aggregation to improve performance and reduce memory usage

go test -bench . -benchmem

goos: darwin
goarch: arm64
pkg: sigs.k8s.io/cloud-provider-azure/pkg/provider/loadbalancer/iputil
cpu: Apple M1 Max
BenchmarkAggregatePrefixes-10                        290           4031636 ns/op        11123568 B/op         39 allocs/op
BenchmarkAggregatePrefixesWithPrefixTree-10           98          12106605 ns/op        19511091 B/op     131121 allocs/op

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Optimize CIDR aggregation to improve performance and reduce memory usage

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Oct 5, 2024
@k8s-ci-robot k8s-ci-robot requested review from jwtty and nilo19 October 5, 2024 11:41
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 5, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @zarvd. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 5, 2024
@zarvd zarvd force-pushed the perf/cidr/aggregate branch from 4a142cc to effae48 Compare October 5, 2024 13:01
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 5, 2024
@zarvd zarvd changed the title Optimize CIDR aggregation in NetworkSecurityGroup for enhanced performance Optimize CIDR aggregation to improve performance and reduce memory usage Oct 5, 2024
@zarvd zarvd force-pushed the perf/cidr/aggregate branch from effae48 to 10cc225 Compare October 7, 2024 22:46
@nilo19
Copy link
Contributor

nilo19 commented Oct 7, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 7, 2024
@zarvd zarvd force-pushed the perf/cidr/aggregate branch 3 times, most recently from 5c25344 to 312fa1d Compare October 9, 2024 23:35
@zarvd
Copy link
Contributor Author

zarvd commented Oct 10, 2024

/retest

@zarvd zarvd force-pushed the perf/cidr/aggregate branch 2 times, most recently from 3db2a80 to 50bb0ca Compare October 11, 2024 02:15
@zarvd
Copy link
Contributor Author

zarvd commented Oct 11, 2024

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 11, 2024
@zarvd zarvd force-pushed the perf/cidr/aggregate branch from 50bb0ca to 14dde56 Compare October 14, 2024 00:00
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 14, 2024
@zarvd zarvd force-pushed the perf/cidr/aggregate branch from 14dde56 to 643e90e Compare October 17, 2024 23:12
@zarvd
Copy link
Contributor Author

zarvd commented Oct 18, 2024

/retest

@zarvd zarvd force-pushed the perf/cidr/aggregate branch 2 times, most recently from fd1181a to edfb7a8 Compare October 18, 2024 23:51
@zarvd zarvd force-pushed the perf/cidr/aggregate branch 2 times, most recently from 1ea3ce5 to 72bd7b1 Compare October 21, 2024 23:42
@zarvd
Copy link
Contributor Author

zarvd commented Oct 22, 2024

/retest

@zarvd zarvd force-pushed the perf/cidr/aggregate branch from 72bd7b1 to d6a3bc9 Compare October 24, 2024 03:10
@zarvd
Copy link
Contributor Author

zarvd commented Oct 24, 2024

/retest

@zarvd zarvd force-pushed the perf/cidr/aggregate branch from d6a3bc9 to 0c90566 Compare October 25, 2024 00:46
@coveralls
Copy link

Coverage Status

coverage: 76.793% (+0.06%) from 76.735%
when pulling 0c90566 on zarvd:perf/cidr/aggregate
into 103c158 on kubernetes-sigs:master.

@zarvd zarvd force-pushed the perf/cidr/aggregate branch from 0c90566 to 846c300 Compare October 27, 2024 23:23
@MartinForReal
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 20, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MartinForReal, zarvd

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 20, 2024
@zarvd zarvd force-pushed the perf/cidr/aggregate branch from 846c300 to b372f55 Compare November 20, 2024 02:56
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 20, 2024
@MartinForReal
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 20, 2024
@k8s-ci-robot k8s-ci-robot merged commit 8ac3152 into kubernetes-sigs:master Nov 20, 2024
18 checks passed
@MartinForReal
Copy link
Contributor

/cherrypick release-1.31

@MartinForReal
Copy link
Contributor

/cherrypick release-1.30

@MartinForReal
Copy link
Contributor

/cherrypick release-1.29

@k8s-infra-cherrypick-robot

@MartinForReal: new pull request created: #7685

In response to this:

/cherrypick release-1.31

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-infra-cherrypick-robot

@MartinForReal: new pull request created: #7686

In response to this:

/cherrypick release-1.30

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-infra-cherrypick-robot

@MartinForReal: new pull request created: #7687

In response to this:

/cherrypick release-1.29

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants