Re: RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads [v2]

2023-01-02 Thread Xubo Zhang
On Mon, 14 Nov 2022 16:37:41 GMT, Xubo Zhang wrote: >> NativePRNG SecureRandom doesn’t scale with number of threads. The >> performance starts dropping as we increase the number of threads. Even going >> from 1 thread to 2 threads shows significant drop. The bottleneck is the >> singleton Rand

Re: RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads [v2]

2022-11-17 Thread Xubo Zhang
On Mon, 14 Nov 2022 16:37:41 GMT, Xubo Zhang wrote: >> NativePRNG SecureRandom doesn’t scale with number of threads. The >> performance starts dropping as we increase the number of threads. Even going >> from 1 thread to 2 threads shows significant drop. The bottleneck is the >> singleton Rand

Re: RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads [v2]

2022-11-17 Thread Xubo Zhang
On Wed, 16 Nov 2022 21:12:09 GMT, Bernd wrote: > Would it be easier to remove the state (singleton, thread local) caching > completely? If somebody request a new instance just seed and return it. That > might in some situations be even less seeding than once per thread and it > decreases stat

Re: RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads [v2]

2022-11-17 Thread Xubo Zhang
On Wed, 16 Nov 2022 20:59:24 GMT, Volodymyr Paprotski wrote: > Any ideas why it is not scaling linearly with number of threads? One would > think that random numbers are the 'definition' of data-independent and should > scale linearly with number of CPUs it could be that the singleton RandomIO

Re: RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads [v2]

2022-11-17 Thread Alan Bateman
On Mon, 14 Nov 2022 16:37:41 GMT, Xubo Zhang wrote: >> NativePRNG SecureRandom doesn’t scale with number of threads. The >> performance starts dropping as we increase the number of threads. Even going >> from 1 thread to 2 threads shows significant drop. The bottleneck is the >> singleton Rand

Re: RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads [v2]

2022-11-17 Thread Daniel Jeliński
On Tue, 15 Nov 2022 20:46:43 GMT, Xubo Zhang wrote: >> Xubo Zhang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update src/java.base/unix/classes/sun/security/provider/NativePRNG.java >> >> Co-authored-by: Andrey Turbanov > > Hi

Re: RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads [v2]

2022-11-16 Thread Bernd
On Mon, 14 Nov 2022 16:37:41 GMT, Xubo Zhang wrote: >> NativePRNG SecureRandom doesn’t scale with number of threads. The >> performance starts dropping as we increase the number of threads. Even going >> from 1 thread to 2 threads shows significant drop. The bottleneck is the >> singleton Rand

Re: RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads [v2]

2022-11-16 Thread Volodymyr Paprotski
On Mon, 14 Nov 2022 16:37:41 GMT, Xubo Zhang wrote: >> NativePRNG SecureRandom doesn’t scale with number of threads. The >> performance starts dropping as we increase the number of threads. Even going >> from 1 thread to 2 threads shows significant drop. The bottleneck is the >> singleton Rand

Re: RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads [v2]

2022-11-15 Thread Xubo Zhang
On Mon, 14 Nov 2022 16:37:41 GMT, Xubo Zhang wrote: >> NativePRNG SecureRandom doesn’t scale with number of threads. The >> performance starts dropping as we increase the number of threads. Even going >> from 1 thread to 2 threads shows significant drop. The bottleneck is the >> singleton Rand

Re: RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads [v2]

2022-11-14 Thread Xubo Zhang
> NativePRNG SecureRandom doesn’t scale with number of threads. The performance > starts dropping as we increase the number of threads. Even going from 1 > thread to 2 threads shows significant drop. The bottleneck is the singleton > RandomIO instance. Making the RandomIO ThreadLocal helps in re

Re: RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads

2022-11-13 Thread Xue-Lei Andrew Fan
On Wed, 9 Nov 2022 20:15:57 GMT, Xubo Zhang wrote: > NativePRNG SecureRandom doesn’t scale with number of threads. The performance > starts dropping as we increase the number of threads. Even going from 1 > thread to 2 threads shows significant drop. The bottleneck is the singleton > RandomIO

Re: RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads

2022-11-13 Thread Andrey Turbanov
On Wed, 9 Nov 2022 20:15:57 GMT, Xubo Zhang wrote: > NativePRNG SecureRandom doesn’t scale with number of threads. The performance > starts dropping as we increase the number of threads. Even going from 1 > thread to 2 threads shows significant drop. The bottleneck is the singleton > RandomIO

RFR: 8296746: NativePRNG SecureRandom doesn't scale with threads

2022-11-09 Thread Xubo Zhang
NativePRNG SecureRandom doesn’t scale with number of threads. The performance starts dropping as we increase the number of threads. Even going from 1 thread to 2 threads shows significant drop. The bottleneck is the singleton RandomIO instance. Making the RandomIO ThreadLocal helps in removing t