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

chore: enable perfsprint linter #20685

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmorel-35
Copy link
Contributor

@mmorel-35 mmorel-35 commented Nov 6, 2024

enables and fixes int-conversion and sprintf1 rules of perfsprint linter issues.

@mmorel-35 mmorel-35 requested a review from a team as a code owner November 6, 2024 23:35
Copy link

bunnyshell bot commented Nov 6, 2024

✅ Preview Environment deployed on Bunnyshell

Component Endpoints
argocd https://argocd-quqntp.bunnyenv.com/
argocd-ttyd https://argocd-web-cli-quqntp.bunnyenv.com/

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔴 /bns:stop to stop the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Project coverage is 55.10%. Comparing base (a7ff791) to head (dd69451).

Files with missing lines Patch % Lines
util/lua/oslib_safe.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20685      +/-   ##
==========================================
- Coverage   55.19%   55.10%   -0.09%     
==========================================
  Files         324      324              
  Lines       55257    55257              
==========================================
- Hits        30499    30452      -47     
- Misses      22137    22184      +47     
  Partials     2621     2621              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andrii-korotkov-verkada
Copy link
Contributor

Can you share more details about the gains perfsprint gives, please?

@mmorel-35
Copy link
Contributor Author

This suggest methods that are faster in their use and so don't use the extra memory that is necessary when using general function
For example fmt.Sprintf instanciate a printer which is then freed
https://cs.opensource.google/go/go/+/refs/tags/go1.23.3:src/fmt/print.go;l=237
while there is no need when using directly strconv.Itoa when you only need to convert an integer to string.

applicationset/utils/map.go Outdated Show resolved Hide resolved
Signed-off-by: Matthieu MOREL <[email protected]>
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.

2 participants