perf: optimize IsEquals and ToMap to reduce allocations
Optimize URL equality comparison and map conversion to avoid unnecessary allocations. IsEquals() now compares fields directly instead of materializing two full maps via ToMap(). ToMap() pre-sizes the map and uses a single-pass split for Location parsing.
Fixes: #3394
Signed-off-by: [email protected]
Quality Gate passed
Issues
1 New issue
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Codecov Report
:x: Patch coverage is 77.41935% with 14 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 52.42%. Comparing base (e6e14fd) to head (6a5d4c4).
:warning: Report is 60 commits behind head on develop.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| common/url.go | 77.41% | 8 Missing and 6 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## develop #3402 +/- ##
===========================================
+ Coverage 52.40% 52.42% +0.01%
===========================================
Files 492 492
Lines 37785 37826 +41
===========================================
+ Hits 19800 19829 +29
- Misses 16380 16387 +7
- Partials 1605 1610 +5
:umbrella: View full report in Codecov by Harness.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
the target branch should be develop
@ywxzm03 help review this :)
update to latest develop and run https://github.com/apache/dubbo-go/blob/develop/common/url_benchmark_test.go to see the performance shift before and after you commit, and paste the result comparison here
可以参考 https://github.com/apache/dubbo-go/pull/3403 的pr body写法
@JunLa-0 any progess?
@JunLa-0 any progess? If no further update, this pr will be closed and we will assign others to work on this.
close via #3488