RFR: 8366224: Introduce DecimalDigits.appendPair for efficient two-digit formatting and refactor DateTimeHelper [v24]

Roger Riggs rriggs at openjdk.org
Mon Nov 17 14:45:14 UTC 2025


On Fri, 14 Nov 2025 15:50:09 GMT, Shaojin Wen <swen at openjdk.org> wrote:

> The `DecimalDigits.appendPair` and `appendQuad` methods will experience performance degradation if a `StringBuilder` with `Encoding UTF16` is passed to them. This occurs when `DecimalDigits.appendPair` or `appendQuad` is used in `DateTimeFormatter::formatTo`.

Adding single purpose functions to Java Lang Access is not worth the added complexity and maintenance cost.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/26911#issuecomment-3542204264


More information about the core-libs-dev mailing list