RFR : 8007398 : (S) Performance improvements for Int/Long toString() at Radix 2, 8, 16
mike.duigou at oracle.com
Thu May 16 01:17:20 UTC 2013
This issue was originally part of JDK-8006627 (improve performance of UUID parsing/formatting) but was split out because it could be split out. I've been working incrementally on pieces of 8006627 as my time permits.
I've done microbenchmarking of using digits table vs calculating digits, previously mentioned in <http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-April/016526.html>, and found that using the digits table was still faster.
I've also benchmarked removing the offset param from formatUnsignedLong() and simplifying the loop termination logic but neither of these turned out to have little benefit.
Since the last rev I have made a separate implementation Integer.formatUnsignedInteger for use by Integer rather than sharing the Long implementation because it's about 30% faster. I suspect the benefits would be even greater on a 32-bit VM or 32-bit native platform.
We'll get back to 8006627 soon enough. (I have been tempted to split it again into parsing and formatting).
More information about the core-libs-dev