-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
StringBuilderPool #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stupid me: forgot to reset pooled StringBuilders...
Co-authored-by: Stephane Landelle <slandelle@gatling.io>
Co-authored-by: Stephane Landelle <slandelle@gatling.io>
Codecov Report
@@ Coverage Diff @@
## master #2 +/- ##
============================================
- Coverage 74.11% 74.03% -0.09%
- Complexity 2878 2886 +8
============================================
Files 122 123 +1
Lines 9179 9212 +33
Branches 1920 1923 +3
============================================
+ Hits 6803 6820 +17
- Misses 1881 1896 +15
- Partials 495 496 +1
Continue to review full report at Codecov.
|
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.
@slandelle please see my benchmark
Am i doing something wrong? |
@igr Sadly, it looks like the new strategy is only a win for large Strings. I think you can revert latest commit. |
I don't own the PR, otherwise I would have remove the wrong commit. |
Closing this one and opening: #4 |
No description provided.