Skip to content

[release-1.15] istio: improve deep copy for ServiceAttribute #42670

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

Conversation

istio-testing
Copy link
Collaborator

This is an automated cherry-pick of #40966

ying-zhu added 2 commits January 4, 2023 21:57
DeepCopy using reflection is super slow, and a big chunk of init push
context time is doing deep copy. This is already improved a lot by
this PR: istio#37932 (init push context
time drop from 1m30s to 40s). ServiceAttribute DeepCopy is still
taking more than 10% cpu time, so improving this function can further
reduce the init push context time and hence our propagation delay.

Benchmark results:
(before)
goos: darwin
goarch: amd64
pkg: istio.io/istio/pilot/pkg/model
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
BenchmarkServiceDeepCopy
BenchmarkServiceDeepCopy-16    	  132760	      8190 ns/op
PASS

(after)
goos: darwin
goarch: amd64
pkg: istio.io/istio/pilot/pkg/model
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
BenchmarkServiceDeepCopy
BenchmarkServiceDeepCopy-16    	 1213035	      1019 ns/op
PASS

Change-Id: Ied3e81d252ccf226bbb8d1d56eb88bff7c146af4
Reviewed-on: https://gerrit.musta.ch/c/public/istio/+/3700
Reviewed-by: Douglas Jordan <douglas.jordan@airbnb.com>
Reviewed-by: Weibo He <weibo.he@airbnb.com>
AddressMap contains a mutex which govet complains if we return a
copy, ignoring the vet error (behavior is the same as before).

Change-Id: If0274e6e1412eb50586ea609a07c302557297ad8
Reviewed-on: https://gerrit.musta.ch/c/public/istio/+/3706
Reviewed-by: Weibo He <weibo.he@airbnb.com>
@istio-testing istio-testing requested a review from a team January 4, 2023 21:57
@istio-testing istio-testing added release-notes-none Indicates a PR that does not require release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 4, 2023
@dhawton
Copy link
Member

dhawton commented Jan 4, 2023

Istio has a cherry-picking policy that only bug fixes and CVE fixes can be cherry-picked. This PR does not appear to meet that criteria.

@dhawton dhawton closed this Jan 5, 2023
@S-Chan
Copy link
Contributor

S-Chan commented Jan 17, 2023

Thanks for providing the cherry-picking policy!

This PR (and #42671) are performance improvements. For future reference, are those considered a special case of a bug fix, or are bug fixes limited to functional requirements not working as expected?

(Apologies for the delayed reply, forgot to subscribe)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes-none Indicates a PR that does not require release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants