RFR: 8347606: Optimize Java implementation of ML-DSA

Ben Perez bperez at openjdk.org
Fri Feb 14 16:48:30 UTC 2025


It turns out that initializing a multidimensional array with `int[][] a = new int[rows][cols]` is slower than allocating each column in a loop. Since we do a lot of large multidimensional array allocations in ML-DSA, the optimized initialization improves performance by roughly 10%.

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

Commit messages:
 - Changed copyright, removed unnecessary comment
 - Added optimized boolean matrix allocs
 - Created optimized matrixAllocate method for 2d arrays

Changes: https://git.openjdk.org/jdk/pull/23642/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23642&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8347606
  Stats: 56 lines in 1 file changed: 23 ins; 1 del; 32 mod
  Patch: https://git.openjdk.org/jdk/pull/23642.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23642/head:pull/23642

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


More information about the security-dev mailing list