commit | bb3b16f46964155b9ceead25db1c0e3841ce61a7 | [log] [tgz] |
---|---|---|
author | Dan Egnor <egnor@google.com> | Tue Nov 17 15:56:11 2009 -0800 |
committer | Dan Egnor <egnor@google.com> | Tue Nov 17 16:17:34 2009 -0800 |
tree | cf161a9b235385346f4efef4cb526e0816968312 | |
parent | 77af81358320e369dd3aa0dcc912105d1769680e [diff] |
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.