Cache NumberFormat and DecimalFormatSymbols objects in a ThreadLocal,
so they can be reused between multiple instances of Formatter on the
same thread.  This speeds up my unscientific benchmark (a number of
printouts involved in a debugging diagnostics output) by 3x, and
should have a similar impact on anyone who uses String.format(),
PrintWriter.format(), and the like.
2 files changed