Skip to content

Replace Sprintf with string concatenation in gce_url.go#9133

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
x13n:master
Jan 28, 2026
Merged

Replace Sprintf with string concatenation in gce_url.go#9133
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
x13n:master

Conversation

@x13n
Copy link
Copy Markdown
Member

@x13n x13n commented Jan 27, 2026

This change improves performance and reduces allocations in GCE URL generation and parsing functions.

Benchmark results:
BenchmarkGenerateInstanceUrl: 294.8 ns/op -> 73.4 ns/op
BenchmarkGenerateMigUrl: 296.5 ns/op -> 73.7 ns/op
Allocations: 5 allocs/op -> 1 allocs/op

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

[GCE] Minor performance improvement

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


This change improves performance and reduces allocations in GCE URL
generation and parsing functions.

Benchmark results:
BenchmarkGenerateInstanceUrl: 294.8 ns/op -> 73.4 ns/op
BenchmarkGenerateMigUrl: 296.5 ns/op -> 73.7 ns/op
Allocations: 5 allocs/op -> 1 allocs/op
@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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area Indicates that a PR should not merge because it lacks an area label. area/cluster-autoscaler Issues or PRs related to the Cluster Autoscaler component area/provider/gce labels Jan 27, 2026
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed do-not-merge/needs-area Indicates that a PR should not merge because it lacks an area label. labels Jan 27, 2026
@pmendelski
Copy link
Copy Markdown
Contributor

/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pmendelski, x13n

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@towca
Copy link
Copy Markdown
Collaborator

towca commented Jan 28, 2026

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 28, 2026
@k8s-ci-robot k8s-ci-robot merged commit 34c5906 into kubernetes:master Jan 28, 2026
8 checks passed
@jackfrancis
Copy link
Copy Markdown
Contributor

/cherry-pick cluster-autoscaler-release-1.35

@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

@jackfrancis: new pull request created: #9139

Details

In response to this:

/cherry-pick cluster-autoscaler-release-1.35

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. area/cluster-autoscaler Issues or PRs related to the Cluster Autoscaler component area/provider/gce 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants