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
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