RFR: 8347606: Optimize Java implementation of ML-DSA [v2]

Ben Perez bperez at openjdk.org
Tue May 6 20:19:31 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%.

Ben Perez has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits:

 - Merge branch 'master' into JDK-8347606
 - 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=01
  Stats: 54 lines in 1 file changed: 23 ins; 1 del; 30 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