Skip to content
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

Improve performance by replacing StringBuffer with StringBuilder #809

Merged
merged 2 commits into from
Nov 30, 2021
Merged

Improve performance by replacing StringBuffer with StringBuilder #809

merged 2 commits into from
Nov 30, 2021

Conversation

larrydiamond
Copy link
Contributor

Only StringBuffers are being replaced with StringBuilder in this pull request.
No new features in this PR.

StringBuilder is faster than StringBuffer as synchronization does not occur.
This is safe to do for locally used StringBuffers where there is no need for synchronization, all places changed this PR are locally used.

All tests pass.

@larrydiamond
Copy link
Contributor Author

Build failed on Java 8, I'll take a look and fix it up, sorry about that.

@arnaudroques
Copy link
Contributor

Many thanks, tt sounds like a good idea.
Unfortunately, it seems that under Java 8, regex and matcher still need StringBuffer.
It's really a pity but we would like to keep compatibility with Java 8.

@larrydiamond
Copy link
Contributor Author

Makes perfect sense to me. It looks like Java didn't add some methods for StringBuilder until 11. I think I still have 8 installed somewhere, I'll figure it out.

@arnaudroques arnaudroques merged commit 98ad315 into plantuml:master Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants