kube-openapi icon indicating copy to clipboard operation
kube-openapi copied to clipboard

Collect params for OpenAPI V3

Open Jefftree opened this issue 2 years ago • 11 comments
trafficstars

goos: darwin
goarch: arm64
pkg: k8s.io/kube-openapi/pkg/spec3
BenchmarkSharedParamsDeserialize/apiv1spec.json-8         	      98	  12138503 ns/op	12245326 B/op	   60819 allocs/op
BenchmarkSharedParamsDeserialize/apiv1spec.sharedparams.json-8         	     100	  10520641 ns/op	 9892803 B/op	   68528 allocs/op
BenchmarkSharedParamsDeserialize/appsv1spec.json-8                     	     200	   5920978 ns/op	 5708092 B/op	   27386 allocs/op
BenchmarkSharedParamsDeserialize/appsv1spec.sharedparams.json-8        	     230	   5162531 ns/op	 4871387 B/op	   30219 allocs/op
BenchmarkSharedParamsDeserialize/authorizationv1spec.json-8            	    2575	    466165 ns/op	  537114 B/op	    2521 allocs/op
BenchmarkSharedParamsDeserialize/authorizationv1spec.sharedparams.json-8         	    2620	    458194 ns/op	  526593 B/op	    2664 allocs/op
PASS
ok  	k8s.io/kube-openapi/pkg/spec3	9.266s

k/k diff PR: https://github.com/kubernetes/kubernetes/pull/120242

Jefftree avatar Aug 29 '23 18:08 Jefftree

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jefftree

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 avatar Aug 29 '23 18:08 k8s-ci-robot

Can we get a quick performance impact of this?

apelisse avatar Aug 30 '23 22:08 apelisse

https://github.com/kubernetes/kubernetes/pull/120242/commits/afa3e4574edd78b437c3a76637153d1bcb1531a3 shows the OpenAPI diff.

For sizes: /api/v1 showed some nice improvement from 1.7MB -> 1MB The other endpoints had some reduction between 10-20%

I will gather some additional numbers on cpu/mem differences if any exist.

This PR is still WIP, so feel free to hold off on review.

Jefftree avatar Aug 30 '23 22:08 Jefftree

Yeah, I think what you could do is use these new OpenAPI and re-run some of the benchmarks we have to see CPU/Memory allocation reductions.

apelisse avatar Aug 30 '23 22:08 apelisse

@apelisse Attached some benchmarking data. ~15-25% improvement in cpu+mem for the larger gvs and not much difference for the smaller ones. Total # allocs went up slightly, though the total memory impact of the allocs was improved.

Jefftree avatar Aug 31 '23 18:08 Jefftree

/cc @sttts This was pretty much a copy and paste of the v2 param collector with one change.

  • The fieldValidation and dryRun unsharing special condition was removed. The two parameters are used until v1.26 and v1.27 respectively and this change will go into 1.29 which should be outside the 1 version skew that kubectl supports?

Jefftree avatar Sep 06 '23 18:09 Jefftree

Do you know why allocs are going up? I was going to try and find suggestions but let's forget it, it's probably not a big deal anyway.

apelisse avatar Sep 06 '23 18:09 apelisse

PR needs rebase.

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/test-infra repository.

k8s-ci-robot avatar Sep 19 '23 00:09 k8s-ci-robot

@apelisse @sttts This PR will need to be rebased, but is this change something we're okay with landing?

Jefftree avatar Dec 27 '23 21:12 Jefftree

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Mar 26 '24 22:03 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar May 03 '24 12:05 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-triage-robot avatar Jun 02 '24 13:06 k8s-triage-robot

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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 avatar Jun 02 '24 13:06 k8s-ci-robot