test(benchmark): baseline the general-purpose codecs on 128-char input

hexDecode128/hexEncode128 have no denominator in the suite — decode64 can
be read against hexDecodeOurs, but the 64-byte cases had nothing to
compare to. Adds Hex.decode(hex128) and Hex.encode(bytes64) so the
size-enforcing pair's advantage is readable straight off the results.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vitor Pamplona
2026-07-31 22:51:52 -04:00
co-authored by Claude Opus 5
parent 729fb1bc17
commit 29e665a7e0
@@ -133,6 +133,24 @@ class HexBenchmark {
r.measureRepeated { Hex.encode128(bytes64) }
}
/** The general-purpose decoder on the same 128 chars, for comparison with [hexDecode128]. */
@Test
fun hexDecodeOurs128() {
r.measureRepeated {
Hex
.decode(hex128)
}
}
/** The general-purpose encoder on the same 64 bytes, for comparison with [hexEncode128]. */
@Test
fun hexEncodeOurs128() {
r.measureRepeated {
Hex
.encode(bytes64)
}
}
/** The pre-existing two-pass way to safely decode an id, for comparison with [hexDecode64OrNull]. */
@Test
fun hexIsHex64ThenDecode() {