-
Couldn't load subscription status.
- Fork 25.6k
Use StringBuilder instead of StringBuffer #128665
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
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
(Failing test is unrelated) |
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.
Wow! I thought this had been done ages ago. I'm a little surprised to see these left-over bits.
Replace non-multithreaded uses of
StringBuffertoStringBuilder.From the
StringBufferjavadoc:Just in case, and out of curiosity, made a little microbenchmark to check the difference both between a
StringBufferand aStringBuilder, and between a synchronized and non-synchronized method. The results are "as expected", and tell me that this won't affect negatively:The main reason to do this isn't performance anyway, but to avoid using this class when it's not needed.