Should I use Java’s String.format() if performance is important?

I took hhafez code and added a memory test: private static void test() { Runtime runtime = Runtime.getRuntime(); long memory; … memory = runtime.freeMemory(); // for loop code memory = memory-runtime.freeMemory(); I run this separately for each approach, the ‘+’ operator, String.format and StringBuilder (calling toString()), so the memory used will not be affected by … Read more