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

fix: speed up labelsToString #295

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

tzneal
Copy link
Contributor

@tzneal tzneal commented Apr 17, 2023

Fixes #

Description

This function shows up in profiling as taking a significant amount of time. At least for now, make is ~2x as fast.

benchstat results of before -> after:

name         old time/op  new time/op  delta
Original-12  32.5µs ± 1%  13.9µs ± 2%  -57.26%  (p=0.000 n=10+10)

How was this change tested?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This function shows up in profiling as taking a significant amount of
time.  At least for now, make is ~2x as fast.

benchstat results of before -> after:

name         old time/op  new time/op  delta
Original-12  32.5µs ± 1%  13.9µs ± 2%  -57.26%  (p=0.000 n=10+10)
@tzneal tzneal requested a review from a team as a code owner April 17, 2023 00:40
@tzneal tzneal requested a review from njtran April 17, 2023 00:40
@tzneal
Copy link
Contributor Author

tzneal commented Apr 17, 2023

It caught my attention when I saw this in a profile:

Screen Shot 2023-04-16 at 7 41 03 PM

@coveralls
Copy link

coveralls commented Apr 17, 2023

Pull Request Test Coverage Report for Build 4716234064

  • 22 of 22 (100.0%) changed or added relevant lines in 1 file are covered.
  • 15 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.04%) to 81.387%

Files with Coverage Reduction New Missed Lines %
pkg/controllers/state/cluster.go 6 84.47%
pkg/controllers/deprovisioning/controller.go 9 80.0%
Totals Coverage Status
Change from base Build 4702463214: -0.04%
Covered Lines: 6760
Relevant Lines: 8306

💛 - Coveralls

@ellistarn
Copy link
Contributor

I know @jonathan-innis is working on a metrics rewrite -- maybe it's possible to avoid this entirely (or a at a different frequency) somehow.

@tzneal tzneal merged commit 31b06e6 into kubernetes-sigs:main Apr 17, 2023
@tzneal tzneal deleted the speed-up-labels-to-string branch April 17, 2023 12:47
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants