What's the fastest way to concatenate two Strings in Java?
i.e
String ccyPair = ccy1 + ccy2;
I'm using cyPair
as a key in a HashMap
and it's called in a very tight loop to retrieve values.
When I profile then this is the bottleneck
java.lang.StringBuilder.append(StringBuilder.java:119)
java.lang.StringBuilder.(StringBuilder.java:93)
See Question&Answers more detail:os