Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-30 Thread Weijun Wang
On Wed, 24 Nov 2021 21:17:34 GMT, Valerie Peng wrote: >> It is observed that when running crypto benchmark with large number of >> threads, a lot of time is spent on the synchronized block inside the >> Provider.getService() method. The cause for this is that >> Provider.getService() method fi

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-30 Thread Valerie Peng
On Tue, 30 Nov 2021 20:50:53 GMT, Weijun Wang wrote: > Consider this case, two threads are changing a value at the same time. Since > the method is not synchonized, thread1 might finish the first part of the > method (`super.replace`) earlier than thread2, but it finishes the second > part (`p

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-30 Thread Valerie Peng
On Tue, 30 Nov 2021 13:59:16 GMT, Weijun Wang wrote: >> The serialized bytes are just the mappings, i.e. key + value pairs. There >> are no ordering info associated with the key + value pair. IIRC, the >> particular thing about SecureRandom is that the first registration of >> SecureRandom is

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-30 Thread Weijun Wang
On Wed, 24 Nov 2021 21:17:34 GMT, Valerie Peng wrote: >> It is observed that when running crypto benchmark with large number of >> threads, a lot of time is spent on the synchronized block inside the >> Provider.getService() method. The cause for this is that >> Provider.getService() method fi

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-30 Thread Valerie Peng
On Mon, 29 Nov 2021 23:24:59 GMT, Weijun Wang wrote: > Some comments. I'm more concerned about the `parseLegacy()` method which is > called everywhere. Without the synchronized keyword, is it safe to call into > this method by multiple threads at the same time? Do we have tests around > this?

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-30 Thread Weijun Wang
On Tue, 30 Nov 2021 02:40:22 GMT, Valerie Peng wrote: >> src/java.base/share/classes/java/security/Provider.java line 832: >> >>> 830: // NOTE: may need extra mechanism for providers to indicate their >>> 831: // preferred ordering of SecureRandom algorithms since registration >>> 832:

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-30 Thread Weijun Wang
On Tue, 30 Nov 2021 02:47:45 GMT, Valerie Peng wrote: >> src/java.base/share/classes/java/security/Provider.java line 979: >> >>> 977: parseLegacy(sk, sv, OPType.REPLACE); >>> 978: } >>> 979: } >> >> If you are going through all the entries, should we also cl

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-29 Thread Valerie Peng
On Mon, 29 Nov 2021 23:10:03 GMT, Weijun Wang wrote: >> Valerie Peng has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Updated to use pattern matching with instanceof operator. > > src/java.base/share/classes/java/security/Provider.java li

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-29 Thread Valerie Peng
On Tue, 23 Nov 2021 15:02:55 GMT, Weijun Wang wrote: >> Valerie Peng has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Updated to use pattern matching with instanceof operator. > > src/java.base/share/classes/java/security/Provider.java li

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-29 Thread Valerie Peng
On Thu, 25 Nov 2021 10:42:14 GMT, Andrey Turbanov wrote: >> Valerie Peng has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Updated to use pattern matching with instanceof operator. > > src/java.base/share/classes/java/security/Provider.jav

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-29 Thread Valerie Peng
On Thu, 25 Nov 2021 10:41:32 GMT, Andrey Turbanov wrote: >> Valerie Peng has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Updated to use pattern matching with instanceof operator. > > src/java.base/share/classes/java/security/Provider.jav

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-29 Thread Weijun Wang
On Wed, 24 Nov 2021 21:17:34 GMT, Valerie Peng wrote: >> It is observed that when running crypto benchmark with large number of >> threads, a lot of time is spent on the synchronized block inside the >> Provider.getService() method. The cause for this is that >> Provider.getService() method fi

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-25 Thread Andrey Turbanov
On Wed, 24 Nov 2021 21:17:34 GMT, Valerie Peng wrote: >> It is observed that when running crypto benchmark with large number of >> threads, a lot of time is spent on the synchronized block inside the >> Provider.getService() method. The cause for this is that >> Provider.getService() method fi

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-25 Thread Andrey Turbanov
On Wed, 24 Nov 2021 21:17:34 GMT, Valerie Peng wrote: >> It is observed that when running crypto benchmark with large number of >> threads, a lot of time is spent on the synchronized block inside the >> Provider.getService() method. The cause for this is that >> Provider.getService() method fi

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-24 Thread Valerie Peng
On Tue, 23 Nov 2021 08:25:42 GMT, Andrey Turbanov wrote: >> Valerie Peng has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Updated to use pattern matching with instanceof operator. > > src/java.base/share/classes/java/security/Provider.jav

Re: RFR: 8276660: Scalability bottleneck in java.security.Provider.getService() [v2]

2021-11-24 Thread Valerie Peng
> It is observed that when running crypto benchmark with large number of > threads, a lot of time is spent on the synchronized block inside the > Provider.getService() method. The cause for this is that > Provider.getService() method first uses the 'serviceMap' field to find the > requested ser