33 ms·
>> FUBARed the Java implementation << // deliberately *not* using StringBuffer / StringBuilder, // as a real app would have many transient string varia
by igouy 14y ago
>> FUBARed the Java implementation <<
// deliberately *not* using StringBuffer / StringBuilder,
// as a real app would have many transient string variables
- Roboprog 14y agoBecause I know that every corporate app dev is (NOT) going to write: StringBuilder buf = new StringBuilder( s1); buf.append( s2); String cat = buf.toString(); instead of: String cat = s1 + s1; in their application code. (although I think that is pretty much what the compiler generates on your behalf, anyway) The loop is in the benchmark so I don't have to write code dealing with many different string values of differing size manually.