On Wed, 15 Mar 2023 12:13:00 GMT, Claes Redestad <[email protected]> wrote:
>> Btw, I think we can do the same for `StringLatin1.canEncode()`
>
> It seems reasonable to keep these two in sync, yes. (`CharacterData.of` could
> even call into `StringLatin1.canEncode`, unless that's cause for some
> performance anomaly)
> `if (ch && 0xFFFFFF00 == 0) {`
This seems to perform similar to baseline:
Benchmark (codePoint) Mode Cnt Score Error Units
Characters.isDigit 48 avgt 15 0.890 ± 0.025 ns/op
Characters.isDigit 1632 avgt 15 2.174 ± 0.011 ns/op
Would be interesting to check the performance on non-Intel architectures. If
you want to give it a spin on your M1, here's the benchmark command I used:
`make test TEST='micro:java.lang.Characters.isDigit' MICRO="OPTIONS=-p
codePoint=48,1632"`
-------------
PR: https://git.openjdk.org/jdk/pull/13040