Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v4]

2024-02-09 Thread Oli Gillespie
On Tue, 6 Feb 2024 13:52:09 GMT, Oli Gillespie wrote: >> Avoid expensive `Class.forName` call when constructing Providers such as >> `SecureRandom` which take constructor parameters. This can easily be cached >> in EngineDescription (this cache already existed before, it was removed in >> [JDK

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v4]

2024-02-06 Thread Oli Gillespie
> Avoid expensive `Class.forName` call when constructing Providers such as > `SecureRandom` which take constructor parameters. This can easily be cached > in EngineDescription (this cache already existed before, it was removed in > [JDK-8280970](https://bugs.openjdk.org/browse/JDK-8280970) as un

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v3]

2024-02-06 Thread Oli Gillespie
On Thu, 1 Feb 2024 10:39:27 GMT, Oli Gillespie wrote: >> Avoid expensive `Class.forName` call when constructing Providers such as >> `SecureRandom` which take constructor parameters. This can easily be cached >> in EngineDescription (this cache already existed before, it was removed in >> [JDK

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v3]

2024-02-06 Thread Weijun Wang
On Thu, 1 Feb 2024 10:39:27 GMT, Oli Gillespie wrote: >> Avoid expensive `Class.forName` call when constructing Providers such as >> `SecureRandom` which take constructor parameters. This can easily be cached >> in EngineDescription (this cache already existed before, it was removed in >> [JDK

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v3]

2024-02-06 Thread Aleksey Shipilev
On Thu, 1 Feb 2024 10:39:27 GMT, Oli Gillespie wrote: >> Avoid expensive `Class.forName` call when constructing Providers such as >> `SecureRandom` which take constructor parameters. This can easily be cached >> in EngineDescription (this cache already existed before, it was removed in >> [JDK

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-02-01 Thread Oli Gillespie
On Wed, 24 Jan 2024 18:05:50 GMT, Oli Gillespie wrote: >> Avoid expensive `Class.forName` call when constructing Providers such as >> `SecureRandom` which take constructor parameters. This can easily be cached >> in EngineDescription (this cache already existed before, it was removed in >> [JD

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v3]

2024-02-01 Thread Oli Gillespie
> Avoid expensive `Class.forName` call when constructing Providers such as > `SecureRandom` which take constructor parameters. This can easily be cached > in EngineDescription (this cache already existed before, it was removed in > [JDK-8280970](https://bugs.openjdk.org/browse/JDK-8280970) as un

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-01-31 Thread Valerie Peng
On Wed, 24 Jan 2024 18:05:50 GMT, Oli Gillespie wrote: >> Avoid expensive `Class.forName` call when constructing Providers such as >> `SecureRandom` which take constructor parameters. This can easily be cached >> in EngineDescription (this cache already existed before, it was removed in >> [JD

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-01-31 Thread Weijun Wang
On Wed, 24 Jan 2024 18:05:50 GMT, Oli Gillespie wrote: >> Avoid expensive `Class.forName` call when constructing Providers such as >> `SecureRandom` which take constructor parameters. This can easily be cached >> in EngineDescription (this cache already existed before, it was removed in >> [JD

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-01-31 Thread Oli Gillespie
On Wed, 24 Jan 2024 18:05:50 GMT, Oli Gillespie wrote: >> Avoid expensive `Class.forName` call when constructing Providers such as >> `SecureRandom` which take constructor parameters. This can easily be cached >> in EngineDescription (this cache already existed before, it was removed in >> [JD

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-01-31 Thread Valerie Peng
On Wed, 24 Jan 2024 18:05:50 GMT, Oli Gillespie wrote: >> Avoid expensive `Class.forName` call when constructing Providers such as >> `SecureRandom` which take constructor parameters. This can easily be cached >> in EngineDescription (this cache already existed before, it was removed in >> [JD

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-01-31 Thread Oli Gillespie
On Wed, 31 Jan 2024 17:23:42 GMT, Weijun Wang wrote: > How about just using class literals? There is no need to call > `Class.forName`, at least not now since they are all inside `java.base`. Thanks :). That seems sensible if writing from scratch, but that part I'm just reviving from [JDK-8280

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-01-31 Thread Weijun Wang
On Wed, 24 Jan 2024 18:05:50 GMT, Oli Gillespie wrote: >> Avoid expensive `Class.forName` call when constructing Providers such as >> `SecureRandom` which take constructor parameters. This can easily be cached >> in EngineDescription (this cache already existed before, it was removed in >> [JD

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-01-29 Thread Aleksey Shipilev
On Wed, 24 Jan 2024 18:05:50 GMT, Oli Gillespie wrote: >> Avoid expensive `Class.forName` call when constructing Providers such as >> `SecureRandom` which take constructor parameters. This can easily be cached >> in EngineDescription (this cache already existed before, it was removed in >> [JD

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-01-25 Thread Oli Gillespie
On Wed, 24 Jan 2024 20:09:12 GMT, Roger Riggs wrote: >> I don't disagree in principle but it was like this before the revert, and is >> still like this in 17. > > Is volatile really needed? And there is some performance penalty and in > practice the value will be the same even if recomputed. S

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-01-24 Thread Roger Riggs
On Wed, 24 Jan 2024 17:57:38 GMT, Oli Gillespie wrote: >> src/java.base/share/classes/java/security/Provider.java line 1560: >> >>> 1558: final boolean supportsParameter; >>> 1559: final String constructorParameterClassName; >>> 1560: private volatile Class constructorPar

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-01-24 Thread Aleksey Shipilev
On Wed, 24 Jan 2024 17:57:46 GMT, Oli Gillespie wrote: > Aside: The classes saved here are limited to the 31 explicitly added in > Provider.. I'm not sure if that helps limit the leak potential > significantly? True. Might not even be an issue in practice. I think the argument for keeping the

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-01-24 Thread Oli Gillespie
> Avoid expensive `Class.forName` call when constructing Providers such as > `SecureRandom` which take constructor parameters. This can easily be cached > in EngineDescription (this cache already existed before, it was removed in > [JDK-8280970](https://bugs.openjdk.org/browse/JDK-8280970) as un

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor [v2]

2024-01-24 Thread Oli Gillespie
On Wed, 24 Jan 2024 17:45:06 GMT, Aleksey Shipilev wrote: >> Oli Gillespie has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Rename newSecureRandom -> create >> - Add copyright header to new file > > src/java.base/share/classes/java/sec

Re: RFR: 8324646: Avoid Class.forName in SecureRandom constructor

2024-01-24 Thread Aleksey Shipilev
On Wed, 24 Jan 2024 15:25:28 GMT, Oli Gillespie wrote: > Avoid expensive `Class.forName` call when constructing Providers such as > `SecureRandom` which take constructor parameters. This can easily be cached > in EngineDescription (this cache already existed before, it was removed in > [JDK-82