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 all rules of perfsprint linter #6164

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

mmorel-35
Copy link
Contributor

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

Description of the changes

How was this change tested?

  • CI

Checklist

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.47%. Comparing base (0a24f6d) to head (9de0146).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6164   +/-   ##
=======================================
  Coverage   96.47%   96.47%           
=======================================
  Files         354      354           
  Lines       20126    20126           
=======================================
  Hits        19417    19417           
  Misses        524      524           
  Partials      185      185           
Flag Coverage Δ
badger_v1 8.31% <0.00%> (ø)
badger_v2 1.67% <0.00%> (ø)
cassandra-4.x-v1 14.39% <0.00%> (ø)
cassandra-4.x-v2 1.61% <0.00%> (ø)
cassandra-5.x-v1 14.39% <0.00%> (ø)
cassandra-5.x-v2 1.61% <0.00%> (ø)
elasticsearch-6.x-v1 18.60% <66.66%> (ø)
elasticsearch-7.x-v1 18.68% <66.66%> (ø)
elasticsearch-8.x-v1 18.85% <66.66%> (ø)
elasticsearch-8.x-v2 1.67% <0.00%> (ø)
grpc_v1 9.48% <0.00%> (ø)
grpc_v2 7.00% <0.00%> (+<0.01%) ⬆️
kafka-v1 8.88% <0.00%> (ø)
kafka-v2 1.67% <0.00%> (ø)
memory_v2 1.66% <0.00%> (-0.02%) ⬇️
opensearch-1.x-v1 18.72% <66.66%> (-0.01%) ⬇️
opensearch-2.x-v1 18.73% <66.66%> (ø)
opensearch-2.x-v2 1.66% <0.00%> (-0.02%) ⬇️
tailsampling-processor 0.46% <0.00%> (ø)
unittests 95.38% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@mmorel-35 mmorel-35 marked this pull request as ready for review November 5, 2024 06:29
@mmorel-35 mmorel-35 requested a review from a team as a code owner November 5, 2024 06:29
@@ -138,11 +139,11 @@ func (e *bridgeFieldEncoder) AddTime(key string, value time.Time) {
}

func (e *bridgeFieldEncoder) AddUint(key string, value uint) {
e.pairs = append(e.pairs, attribute.String(key, fmt.Sprintf("%d", value)))
e.pairs = append(e.pairs, attribute.String(key, strconv.FormatUint(uint64(value), 10)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more performant

}

func (e *bridgeFieldEncoder) AddUint64(key string, value uint64) {
e.pairs = append(e.pairs, attribute.String(key, fmt.Sprintf("%d", value)))
e.pairs = append(e.pairs, attribute.String(key, strconv.FormatUint(value, 10)))
Copy link
Member

@yurishkuro yurishkuro Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks way uglier than sprintf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand, this is more performant

@yurishkuro yurishkuro merged commit 38a9993 into jaegertracing:main Nov 7, 2024
51 of 52 checks passed
@mmorel-35 mmorel-35 deleted the golangci-lint/perfsprint branch November 7, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants