Skip to content

Conversation

@claudecodering
Copy link

@claudecodering claudecodering commented Oct 31, 2025

Which problem is this PR solving?

Description of the changes

strings.Builder has fewer memory allocations and better performance.
More info: golang/go#75190

How was this change tested?

No need.

Checklist

@claudecodering claudecodering requested a review from a team as a code owner October 31, 2025 09:03
@claudecodering claudecodering changed the title [refactor]: use slices.Contains to simplify code [refactor]: use strings.Builder to improve performance Oct 31, 2025
@mahadzaryab1
Copy link
Collaborator

@claudecodering Is there a linter that would enforce this change?

@claudecodering
Copy link
Author

@claudecodering Is there a linter that would enforce this change?

I wrote one locally, but it only performs detection — most of the changes still require manual intervention.

@mahadzaryab1
Copy link
Collaborator

@claudecodering Is there a linter that would enforce this change?

I wrote one locally, but it only performs detection — most of the changes still require manual intervention.

@claudecodering Looks like perfsprint has a concat-loop option that can be used to check for this exact case. Do you want to turn that on in this PR as well?

@claudecodering
Copy link
Author

@claudecodering Is there a linter that would enforce this change?

I wrote one locally, but it only performs detection — most of the changes still require manual intervention.

@claudecodering Looks like perfsprint has a concat-loop option that can be used to check for this exact case. Do you want to turn that on in this PR as well?

Of course! I’d love to do that.

@claudecodering
Copy link
Author

Please review again.

@mahadzaryab1 mahadzaryab1 added the changelog:refactoring Internal code refactoring without functional changes label Nov 7, 2025
@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.53%. Comparing base (528476f) to head (1ae76e4).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7630      +/-   ##
==========================================
- Coverage   96.59%   96.53%   -0.06%     
==========================================
  Files         384      384              
  Lines       19404    19476      +72     
==========================================
+ Hits        18744    18802      +58     
- Misses        477      489      +12     
- Partials      183      185       +2     
Flag Coverage Δ
badger_v1 8.82% <ø> (-0.01%) ⬇️
badger_v2 1.72% <ø> (-0.02%) ⬇️
cassandra-4.x-v1-manual 12.55% <ø> (-0.02%) ⬇️
cassandra-4.x-v2-auto 1.72% <ø> (-0.02%) ⬇️
cassandra-4.x-v2-manual 1.72% <ø> (-0.02%) ⬇️
cassandra-5.x-v1-manual 12.55% <ø> (-0.02%) ⬇️
cassandra-5.x-v2-auto 1.72% <ø> (-0.02%) ⬇️
cassandra-5.x-v2-manual 1.72% <ø> (-0.02%) ⬇️
clickhouse 1.65% <ø> (-0.02%) ⬇️
elasticsearch-6.x-v1 16.75% <ø> (-0.02%) ⬇️
elasticsearch-7.x-v1 16.78% <ø> (-0.02%) ⬇️
elasticsearch-8.x-v1 16.92% <ø> (-0.02%) ⬇️
elasticsearch-8.x-v2 1.72% <ø> (-0.02%) ⬇️
elasticsearch-9.x-v2 1.72% <ø> (-0.02%) ⬇️
grpc_v1 10.75% <ø> (-0.02%) ⬇️
grpc_v2 1.72% <ø> (-0.02%) ⬇️
kafka-3.x-v1 10.25% <ø> (-0.01%) ⬇️
kafka-3.x-v2 1.72% <ø> (-0.02%) ⬇️
memory_v2 1.72% <ø> (-0.02%) ⬇️
opensearch-1.x-v1 16.82% <ø> (-0.02%) ⬇️
opensearch-2.x-v1 16.82% <ø> (-0.02%) ⬇️
opensearch-2.x-v2 1.72% <ø> (-0.02%) ⬇️
opensearch-3.x-v2 1.72% <ø> (-0.02%) ⬇️
query 1.72% <ø> (-0.02%) ⬇️
tailsampling-processor 0.50% <ø> (-0.01%) ⬇️
unittests 95.44% <100.00%> (-0.06%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mahadzaryab1
Copy link
Collaborator

@claudecodering The CI is failing. This PR needs to be opened from a branch on your fork instead of main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/storage changelog:refactoring Internal code refactoring without functional changes performance storage/elasticsearch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants