Skip to content

refactor: use strings.Builder to improve performance - #22453

Merged
wy65701436 merged 1 commit into
goharbor:mainfrom
rocksload:main
Oct 24, 2025
Merged

refactor: use strings.Builder to improve performance#22453
wy65701436 merged 1 commit into
goharbor:mainfrom
rocksload:main

Conversation

@rocksload

@rocksload rocksload commented Oct 11, 2025

Copy link
Copy Markdown
Contributor

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Issue being fixed

Fixes #(issue)

strings.Builder has fewer memory allocations and better performance.

More info: golang/go#75190

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

Signed-off-by: rocksload <rocksload@outlook.com>
@rocksload
rocksload requested a review from a team as a code owner October 11, 2025 13:03
@stonezdj
stonezdj self-requested a review October 13, 2025 09:18

@wy65701436 wy65701436 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@wy65701436
wy65701436 merged commit 5402ac7 into goharbor:main Oct 24, 2025
9 of 10 checks passed
@codecov

codecov Bot commented Oct 24, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.86%. Comparing base (c8c11b4) to head (c67332b).
⚠️ Report is 582 commits behind head on main.

Files with missing lines Patch % Lines
src/common/api/base.go 0.00% 3 Missing ⚠️
src/pkg/task/dao/execution.go 83.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main   #22453       +/-   ##
===========================================
+ Coverage   45.36%   65.86%   +20.50%     
===========================================
  Files         244     1073      +829     
  Lines       13333   116037   +102704     
  Branches     2719     2931      +212     
===========================================
+ Hits         6049    76433    +70384     
- Misses       6983    35364    +28381     
- Partials      301     4240     +3939     
Flag Coverage Δ
unittests 65.86% <73.33%> (+20.50%) ⬆️

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

Files with missing lines Coverage Δ
src/pkg/cached/manager.go 100.00% <100.00%> (ø)
src/pkg/task/dao/execution.go 61.82% <83.33%> (ø)
src/common/api/base.go 10.48% <0.00%> (ø)

... and 984 files with indirect coverage changes

🚀 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.

@bupd

bupd commented Oct 24, 2025

Copy link
Copy Markdown
Member

@wy65701436 @stonezdj

Please add release-note/ before merging the PR

@OrlinVasilev OrlinVasilev added the release-note/update Update or Fix label Oct 28, 2025
@OrlinVasilev

Copy link
Copy Markdown
Member

@wy65701436 please don't merge PR without proper labels, thank you!

OrlinVasilev pushed a commit to OrlinVasilev/harbor that referenced this pull request Oct 29, 2025
Signed-off-by: rocksload <rocksload@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/update Update or Fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants