commit | 84a0540c3925ef1e48ea3ef310db76adce1246fa | [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 | cbef49bcf35de7db4e1bbfab9afcedb19ee1c28e | |
parent | 3cc642cb0627dd99441bf90f72054de81a5948cf [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.