dgageot/foobarqix — comment on commit 38fe3e4d40d598f685d5f5b9dff33bad5f1f9445
File:  line 0
By henri-tremblay:

It is faster but I must say I've kept the String on purpose. To keep the listener interface simple. The CharSequence is a good idea though. But then, This is still faster:
StringBuilder result = new StringBuilder(12); // 12 being the longest possible result
for (int i = firstNumber; i <= lastNumber; i++) {
convertNumber(i, result);
listener.handleNumberResult(i, result);
result.setLength(0);
}
As I said, the JDK isn't reusing the StringBuilder and instantiating it still cost.