RFR: 8316426: Optimization for HexFormat.formatHex

温绍锦 duke at openjdk.org
Mon Sep 18 15:44:57 UTC 2023


In the improvement of @cl4es PR #15591, the advantages of non-lookup-table were discussed.

But if the input is byte[], using lookup table can improve performance.

For HexFormat#formatHex(Appendable, byte[]) and HexFormat#formatHex(byte[]), If the length of byte[] is larger, the performance of table lookup will be improved more obviously.

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

Commit messages:
 - restore toLowHexDigit & toHighHexDigit
 - remove unused import
 - remove AbstractStringBuilder internal method 'appendHex'
 - Remove redundant code in the benchmark
 - optimization for HexFormat.formatHex

Changes: https://git.openjdk.org/jdk/pull/15768/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15768&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8316426
  Stats: 67 lines in 3 files changed: 54 ins; 4 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/15768.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15768/head:pull/15768

PR: https://git.openjdk.org/jdk/pull/15768


More information about the core-libs-dev mailing list