Thank you for the comments Ulf. On Feb 12 2013, at 17:24 , Ulf Zibis wrote:
Am 13.02.2013 00:30, schrieb Mike Duigou:
Hi Steven;
I have updated the patch for Java 8. There's somewhat less code sharing and a bit of refactoring than your last version but the performance should be about the same or a little better.
Couldn't you use String(buf, true) for all to(Unsigned)String(...) methods ?
Possibly. I didn't go looking too far with looking for additional improvements.
Instead of calculating the mask each time, you could use: 309 private static String toUnsignedString(int i, int shift, int mask) {
I think that would actually be inefficient. I haven't looked at the JITed code but the mask calculation is pretty cheap relative to parameter passing.
Additionally in e.g. Integer.toString(int i, int radix) you could provide the fast version with:
I think the only change I will make is to Integer.toUnsignedString() which becomes : return Long.toUnsignedString(toUnsignedLong(i), radix); Mike