Closed slandelle closed 3 years ago
WARNING: performance gain to be verified on small Strings, which is the typical usage in Lagarto's CssSelector#unescape.
Merging #3 into string-builder-pool will increase coverage by
0.03%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## string-builder-pool #3 +/- ##
=========================================================
+ Coverage 74.12% 74.15% +0.03%
+ Complexity 2887 2886 -1
=========================================================
Files 123 123
Lines 9194 9197 +3
Branches 1919 1919
=========================================================
+ Hits 6815 6820 +5
+ Misses 1882 1881 -1
+ Partials 497 496 -1
Impacted Files | Coverage Δ | Complexity Δ | |
---|---|---|---|
src/main/java/jodd/util/StringUtil.java | 96.14% <100.00%> (+0.18%) |
517.00 <4.00> (-1.00) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 7865127...ad2fddd. Read the comment docs.
Motivation:
Chars are currently copied one by one in the StringBuilder.
Modification:
Use String#indexOf to locate char position and then StringBuilder#append(string, start, end) to copy chars by chunk.
Result:
Better performance.