Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8316426

Optimization for HexFormat.formatHex

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • None
    • core-libs
    • None
    • b20

      HexFormat.formatHex can be improved in 2 ways:
      1. Let Appendable formatHex to reuse the formatOptDelimiter shortcut
      2. Use ByteArrayLittleEndian to write 2 bytes at once to speed up the formatOptDelimiter shortcut.

      Fast-path Appendable formatHex now costs at most 1/8 time per operation, and String formatOptDelimiter fast path sees 25% time decrease per operation for lower case formatting and less significant improvements for upper case formatting.

      See https://github.com/openjdk/jdk/pull/15768

            redestad Claes Redestad
            liach Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: