RFR: 8300493: Use ArraysSupport.vectorizedHashCode in j.u.zip.ZipCoder

Claes Redestad redestad at openjdk.org
Wed Jan 18 17:02:09 UTC 2023


`ZipCoder::checkedHashCode` emulates `StringLatin1::hashCode` but operates on a `byte[]` subrange. It can profitably use the recently introduced `ArraysSupport::vectorizedHashCode` method to see a speed-up, which translates to a small but significant speed-up on `ZipFile` creation.

Before:

Benchmark                     (size)  Mode  Cnt       Score      Error  Units
ZipFileOpen.openCloseZipFile     512  avgt   15   83007.325 ± 1446.716  ns/op
ZipFileOpen.openCloseZipFile    1024  avgt   15  154550.631 ± 2166.673  ns/op

After:

Benchmark                     (size)  Mode  Cnt       Score      Error  Units
ZipFileOpen.openCloseZipFile     512  avgt   15   79512.902 ±  814.449  ns/op
ZipFileOpen.openCloseZipFile    1024  avgt   15  147892.522 ± 2744.017  ns/op

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

Commit messages:
 - Use ArraysSupport.vectorizedHashCode in j.u.zip.ZipCoder

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

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



More information about the security-dev mailing list