RFR: 8347606: Optimize Java implementation of ML-DSA

Chen Liang liach at openjdk.org
Fri Feb 21 16:54:55 UTC 2025


On Fri, 14 Feb 2025 16:43:32 GMT, Ben Perez <bperez at openjdk.org> wrote:

> 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%.

We don't need to bring hotspot in. The same issue has been described in https://bugs.openjdk.org/browse/JDK-8308105. We can proceed with this patch.

src/java.base/share/classes/sun/security/provider/ML_DSA.java line 2:

> 1: /*
> 2:  * Copyright (c) 2024, 2025 Oracle and/or its affiliates. All rights reserved.

Suggestion:

 * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.

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

PR Comment: https://git.openjdk.org/jdk/pull/23642#issuecomment-2675063845
PR Review Comment: https://git.openjdk.org/jdk/pull/23642#discussion_r1965870968


More information about the security-dev mailing list