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

2025-05-13 Thread Weijun Wang
On Tue, 13 May 2025 16:49:36 GMT, Ben Perez 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

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

2025-05-13 Thread Ben Perez
> 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

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

2025-05-06 Thread Ben Perez
> 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

Re: RFR: 8347606: Optimize Java implementation of ML-DSA

2025-05-06 Thread Weijun Wang
On Fri, 14 Feb 2025 16:43:32 GMT, Ben Perez 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 > init

Re: RFR: 8347606: Optimize Java implementation of ML-DSA

2025-02-21 Thread John R Rose
On Sun, 16 Feb 2025 15:41:52 GMT, Chen Liang wrote: >> src/java.base/share/classes/sun/security/provider/ML_DSA.java line 1237: >> >>> 1235: return res; >>> 1236: } >>> 1237: >> >> Centralizing the allocation into a helper on its own Looks unseful (for >> resource Management, debu

Re: RFR: 8347606: Optimize Java implementation of ML-DSA

2025-02-21 Thread Johannes Graham
On Fri, 14 Feb 2025 16:43:32 GMT, Ben Perez 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 > init

Re: RFR: 8347606: Optimize Java implementation of ML-DSA

2025-02-21 Thread Chen Liang
On Fri, 14 Feb 2025 16:43:32 GMT, Ben Perez 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 > init

Re: RFR: 8347606: Optimize Java implementation of ML-DSA

2025-02-16 Thread Chen Liang
On Fri, 14 Feb 2025 17:11:16 GMT, Bernd 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 init

Re: RFR: 8347606: Optimize Java implementation of ML-DSA

2025-02-14 Thread Bernd
On Fri, 14 Feb 2025 16:43:32 GMT, Ben Perez 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 > init

RFR: 8347606: Optimize Java implementation of ML-DSA

2025-02-14 Thread Ben Perez
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%.