RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v18]

Claes Redestad redestad at openjdk.org
Tue Sep 12 10:45:53 UTC 2023

On Tue, 12 Sep 2023 10:11:53 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> If there's no significant performance difference I would prefer if we kept `DecimalDigits::DIGITS` big-endian encoded - which is more intuitive to most - and adjust code depending on `DecimalDigits::digitPair` to use `ByteArray` rather than `ByteArrayLittleEndian`.

Just a datapoint but when I test implementing `HexFormat::toHexDigits` using either `ByteArray` or `ByteArrayLittleEndian` then the difference is in the noise:

Name                           Cnt  Base   Error   Test   Error  Unit   Diff%
HexFormatBench.toHexDigitsLong  15 1,950 ± 0,012  1,941 ± 0,016 us/op    0,5% (p = 0,081 )


PR Comment: https://git.openjdk.org/jdk/pull/15651#issuecomment-1715482633

More information about the security-dev mailing list