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

Use faster StringBuilder instead of StringBuffer #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexmojaki
Copy link

From the StringBuffer docs:

As of release JDK 5, this class has been supplemented with an equivalent class designed for use by a single thread, StringBuilder. The StringBuilder class should generally be used in preference to this one, as it supports all of the same operations but it is faster, as it performs no synchronization.

Unless you want to support really old versions of Java or share buffers between threads (neither of which seem to be the case here), use StringBuilder.

From the `StringBuffer` docs:

> As of release JDK 5, this class has been supplemented with an equivalent class designed for use by a single thread, StringBuilder. The StringBuilder class should generally be used in preference to this one, as it supports all of the same operations but it is faster, as it performs no synchronization.

Unless you want to support really old versions of Java or share buffers between threads (neither of which seem to be the case here), use `StringBuilder`.
@davedx
Copy link

davedx commented Mar 9, 2017

Do we really want a hash function with an explicit goal of being slow to go faster? :)

@slisznia
Copy link

slisznia commented Mar 9, 2017 via email

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.

3 participants