Re: large longs to string

2024-04-24 Thread Brett Okken
Claes, > IIUC this optimization leans on 4 long divs being slower than 1 long div + 4 > int divs Exactly. I think there is also some benefit from unrolling the 4 int digit pair operations. > which might not be true on all platforms, nor stay true in the future Agreed, but I am not sure how to

Re: large longs to string

2024-04-24 Thread Claes Redestad
Hi, IIUC this optimization leans on 4 long divs being slower than 1 long div + 4 int divs, which might not be true on all platforms, nor stay true in the future. Long values will in practice likely be biased towards lower values, so it’s important that any optimization to .. longer values doesn

large longs to string

2024-04-24 Thread Brett Okken
Is there interest in optimizing StringLatin1.getChars(long, int, byte[]) for large (larger than int) long values[1]? We can change this to work with 8 digits at a time, which reduces the amount of 64 bit arithmetic required. if (i <= -1_000_000_000) { long q = i / 100_000_000; charPos -= 8; wri