I noticed there's a performance difference between these two styles of using StringBuilder:
StringBuilder text = new StringBuilder();
// style 1
text.append("a" + "b");
// style 2
text.append("a").append("b");
It seems the more data text append, the less efficient style 1 gets. In fact, style 1 took about twice amount of time compared to style 2 in my stress text. Can someone explain why style 1 is less efficient? Thank you for your help!