It seems that memory allocation is the key to the decision of whether to use a StringBuilder or direct concatenation of String objects: The performance of a concatenation operation for a String or StringBuilder object depends on how often a memory allocation occurs.