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

Add micro-benchmark for DeploymentController.getPodMapForDeployment method #79933

Merged
merged 1 commit into from Jul 9, 2019

Conversation

@mm4tt
Copy link
Contributor

commented Jul 9, 2019

This will help us assess improvements we'd like to try in DeploymentController, which were found when investigating #79898

Sample benchmark run:

goos: linux
goarch: amd64
pkg: k8s.io/kubernetes/pkg/controller/deployment
BenchmarkGetPodMapForDeployment-12    	    5000	    286957 ns/op	  553957 B/op	     242 allocs/op
PASS
ok  	k8s.io/kubernetes/pkg/controller/deployment	1.649s

Release Notes:

NONE
@mm4tt

This comment has been minimized.

Copy link
Contributor Author

commented Jul 9, 2019

/sig scalability
/assign @wojtek-t

@k8s-ci-robot k8s-ci-robot requested review from enisoc and janetkuo Jul 9, 2019

@mm4tt mm4tt force-pushed the mm4tt:deployment_benchmark branch from 5e01d1c to a76e64d Jul 9, 2019

f.dLister = append(f.dLister, d)
f.rsLister = append(f.rsLister, rs1, rs2)
f.podLister = append(f.podLister, pods...)
f.objects = append(f.objects, d, rs1, rs2)

This comment has been minimized.

Copy link
@wojtek-t

wojtek-t Jul 9, 2019

Member

append(f.objects, d, rs1, rs2, objects...)

This comment has been minimized.

Copy link
@mm4tt

mm4tt Jul 9, 2019

Author Contributor

I've tried, but it doesn't compile. I guess it's because rs1,rs2 has different type than objects.

defer close(stopCh)
informers.Start(stopCh)

b.ReportAllocs()

This comment has been minimized.

Copy link
@wojtek-t

wojtek-t Jul 9, 2019

Member

please add b.ResetTimer()

This comment has been minimized.

Copy link
@mm4tt

mm4tt Jul 9, 2019

Author Contributor

Done


b.ReportAllocs()
for n := 0; n < b.N; n++ {
_, err := c.getPodMapForDeployment(d, f.rsLister)

This comment has been minimized.

Copy link
@wojtek-t

wojtek-t Jul 9, 2019

Member

I'm wondering if go won't optimize it - maybe we should check the result (e.g. check the size of map or sth)?

This comment has been minimized.

Copy link
@mm4tt

mm4tt Jul 9, 2019

Author Contributor

Added, but it doesn't seem to be making any difference.

@mm4tt
Copy link
Contributor Author

left a comment

Thanks, PTAL

defer close(stopCh)
informers.Start(stopCh)

b.ReportAllocs()

This comment has been minimized.

Copy link
@mm4tt

mm4tt Jul 9, 2019

Author Contributor

Done

f.dLister = append(f.dLister, d)
f.rsLister = append(f.rsLister, rs1, rs2)
f.podLister = append(f.podLister, pods...)
f.objects = append(f.objects, d, rs1, rs2)

This comment has been minimized.

Copy link
@mm4tt

mm4tt Jul 9, 2019

Author Contributor

I've tried, but it doesn't compile. I guess it's because rs1,rs2 has different type than objects.


b.ReportAllocs()
for n := 0; n < b.N; n++ {
_, err := c.getPodMapForDeployment(d, f.rsLister)

This comment has been minimized.

Copy link
@mm4tt

mm4tt Jul 9, 2019

Author Contributor

Added, but it doesn't seem to be making any difference.

@mm4tt mm4tt force-pushed the mm4tt:deployment_benchmark branch from a76e64d to 3e363c5 Jul 9, 2019

@wojtek-t

This comment has been minimized.

Copy link
Member

commented Jul 9, 2019

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm label Jul 9, 2019

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mm4tt, wojtek-t

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

@mm4tt

This comment has been minimized.

Copy link
Contributor Author

commented Jul 9, 2019

/test pull-kubernetes-integration

@k8s-ci-robot k8s-ci-robot merged commit 08a36f6 into kubernetes:master Jul 9, 2019

23 checks passed

cla/linuxfoundation mm4tt authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-iscsi Skipped.
pull-kubernetes-e2e-gce-iscsi-serial Skipped.
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.