Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Minor
-
Resolution: Invalid
-
Affects Version/s: 5.1
-
Fix Version/s: None
-
Component/s: Development Issues only
-
Labels:None
-
Documentation:N/A
-
Documentation in Release Notes:N/A
-
Similar issues:
Description
I’ve noticed that there’s StringBuffer used in most classes instead of StringBuilder. Is there any reason for that? StringBuffer is much slower than StringBuilder due to synchronization, it should be used only when shared between threads. See http://stackoverflow.com/questions/355089/stringbuilder-and-stringbuffer-in-java
Simply use StringBuilder unless you really are trying to share a buffer between threads. StringBuilder is the unsynchronized (less overhead = more efficient) younger brother of the original synchronized StringBuffer class.