Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v19]

2024-06-07 Thread Claes Redestad
On Wed, 5 Jun 2024 12:39:13 GMT, Chen Liang  wrote:

>> Adam Sotona has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   An assortment of potential improvements
>>   
>>   Co-authored-by: Claes Redestad 
>
> src/java.base/share/classes/java/lang/constant/ConstantDescs.java line 356:
> 
>> 354: ClassDesc[] fullParamTypes = new ClassDesc[paramTypes.length + 
>> prefixLen];
>> 355: System.arraycopy(INDY_BOOTSTRAP_ARGS, 0, fullParamTypes, 0, 
>> prefixLen);
>> 356: System.arraycopy(paramTypes, 0, fullParamTypes, prefixLen, 
>> paramTypes.length);
> 
> I'm thinking about creating a basic MethodTypeDesc like `INDY_BOOTSTRAP_TYPE 
> = MethodTypeDesc.ofValidated(CD_Object, INDY_BOOTSTRAP_ARGS)`, and we derive 
> bsm with 
> 
> INDY_BOOTSTRAP_TYPE
> .insertParameterTypes(INDY_BOOTSTRAP_TYPE.parameterCount(), paramTypes)
> .changeReturnType(returnType)
> 
> which creates two MTD wrappers but they share the same parameter array

That'd arguably be a bit cleaner. Might allocate an extra MTD (unless/until EA 
kicks in), but that might not matter really.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1630868455


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v20]

2024-06-05 Thread Chen Liang
On Wed, 5 Jun 2024 12:50:25 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Update test/micro/org/openjdk/bench/java/lang/reflect/ProxyGenBench.java
>   
>   Co-authored-by: Chen Liang 

Marked as reviewed by liach (Author).

-

PR Review: https://git.openjdk.org/jdk/pull/19410#pullrequestreview-2099091898


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v20]

2024-06-05 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> The generated proxy is migrated from static initialization to CONDY bootstrap.
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  Update test/micro/org/openjdk/bench/java/lang/reflect/ProxyGenBench.java
  
  Co-authored-by: Chen Liang 

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/54376fe8..a0822718

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=19
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=18-19

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v19]

2024-06-05 Thread Chen Liang
On Wed, 5 Jun 2024 12:00:25 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   An assortment of potential improvements
>   
>   Co-authored-by: Claes Redestad 

src/java.base/share/classes/java/lang/constant/ConstantDescs.java line 356:

> 354: ClassDesc[] fullParamTypes = new ClassDesc[paramTypes.length + 
> prefixLen];
> 355: System.arraycopy(INDY_BOOTSTRAP_ARGS, 0, fullParamTypes, 0, 
> prefixLen);
> 356: System.arraycopy(paramTypes, 0, fullParamTypes, prefixLen, 
> paramTypes.length);

I'm thinking about creating a basic MethodTypeDesc like `INDY_BOOTSTRAP_TYPE = 
MethodTypeDesc.ofValidated(CD_Object, INDY_BOOTSTRAP_ARGS)`, and we derive bsm 
with 

INDY_BOOTSTRAP_TYPE
.insertParameterTypes(INDY_BOOTSTRAP_TYPE.parameterCount(), paramTypes)
.changeReturnType(returnType)

which creates two MTD wrappers but they share the same parameter array

test/micro/org/openjdk/bench/java/lang/reflect/ProxyGenBench.java line 2:

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

Suggestion:

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

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1627683294
PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1627685503


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v19]

2024-06-05 Thread Claes Redestad
On Wed, 5 Jun 2024 12:00:25 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   An assortment of potential improvements
>   
>   Co-authored-by: Claes Redestad 

Looks good. Generation of proxy classes gets a nice boost this way. The condy 
bsm calls that may happen later takes a small hit which we can improve in a 
follow-up.

-

Marked as reviewed by redestad (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19410#pullrequestreview-2098990024


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v19]

2024-06-05 Thread Adam Sotona
On Wed, 5 Jun 2024 12:00:25 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   An assortment of potential improvements
>   
>   Co-authored-by: Claes Redestad 

Benchmark Mode  Cnt   Score   Error  Units
ProxyGenBench.generate100Proxies(master)ss   10  15.295 ? 5.435  ms/op
ProxyGenBench.generate100Proxies(#19410)ss   10  11.761 ? 3.323  ms/op
Finished running test 'micro:.+ProxyGenBench.+'

-

PR Comment: https://git.openjdk.org/jdk/pull/19410#issuecomment-2149694078


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v19]

2024-06-05 Thread Adam Sotona
On Wed, 5 Jun 2024 12:00:25 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   An assortment of potential improvements
>   
>   Co-authored-by: Claes Redestad 

Name Cnt  Base Error   Test Error   
  Unit  Change
Perfstartup-JMH   2040.000 ±   0.000 40.000 ±   0.000   
 ms/op   1.00x (p = 0.000 )
  :.cycles   236365197.300 ± 3630668.331  224263724.700 ± 4160144.635   
cycles   0.95x (p = 0.000*)
  :.instructions 602001346.250 ± 3134647.039  574894340.900 ± 2297441.310 
instructions   0.95x (p = 0.000*)
  :.taskclock   60.000 ±   0.000 58.500 ±   3.181   
ms   0.98x (p = 0.083 )
  * = significant

-

PR Comment: https://git.openjdk.org/jdk/pull/19410#issuecomment-2149681885


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v19]

2024-06-05 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> The generated proxy is migrated from static initialization to CONDY bootstrap.
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  An assortment of potential improvements
  
  Co-authored-by: Claes Redestad 

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/6ca164bc..54376fe8

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=18
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=17-18

  Stats: 25 lines in 5 files changed: 15 ins; 0 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v18]

2024-06-03 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> The generated proxy is migrated from static initialization to CONDY bootstrap.
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  MethodTypeDescImpl::ofValidated changed to varargs

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/fb3cdcdd..6ca164bc

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=17
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=16-17

  Stats: 14 lines in 2 files changed: 0 ins; 0 del; 14 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v3]

2024-06-03 Thread Adam Sotona
On Mon, 27 May 2024 12:20:20 GMT, Chen Liang  wrote:

>> Adam Sotona has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   performance improvements
>
> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 76:
> 
>> 74: 
>> 75: private static final MethodTypeDesc
>> 76: MTD_boolean = MethodTypeDescImpl.ofValidated(CD_boolean, 
>> ConstantUtils.EMPTY_CLASSDESC),
> 
> Maybe we can change the `MethodTypeDescImpl.ofValidated` to varargs so we 
> don't need explicit array initializations.

Yes, I like that idea.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1624576109


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v17]

2024-06-03 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> The generated proxy is migrated from static initialization to CONDY bootstrap.
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  ClassFile context made static

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/29e269f5..fb3cdcdd

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=16
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=15-16

  Stats: 12 lines in 1 file changed: 3 ins; 8 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v14]

2024-06-03 Thread Adam Sotona
On Mon, 3 Jun 2024 11:37:34 GMT, Claes Redestad  wrote:

>> Adam Sotona has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   ProxyGenBench simplification
>
> test/micro/org/openjdk/bench/java/lang/reflect/Proxy/ProxyGenBench.java line 
> 23:
> 
>> 21:  * questions.
>> 22:  */
>> 23: package org.openjdk.bench.java.lang.reflect.Proxy;
> 
> Package name needs to be lowercase. Not sure why the folder name is uppercase 
> Proxy, but the two pre-existing benchmarks both have lower case package 
> declarations. Uppercase letters in package names may subtly break a few tools

Yes, I've moved it down to j/l/reflect. However the existing benchmarks 
probably need a separate treatment.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1624297815


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v16]

2024-06-03 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> The generated proxy is migrated from static initialization to CONDY bootstrap.
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  fixed package

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/09baa376..29e269f5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=15
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=14-15

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v15]

2024-06-03 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> The generated proxy is migrated from static initialization to CONDY bootstrap.
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  ProxyGenBench moved

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/7b00967d..09baa376

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=14
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=13-14

  Stats: 0 lines in 1 file changed: 0 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v14]

2024-06-03 Thread Claes Redestad
On Mon, 3 Jun 2024 11:09:31 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   ProxyGenBench simplification

test/micro/org/openjdk/bench/java/lang/reflect/Proxy/ProxyGenBench.java line 23:

> 21:  * questions.
> 22:  */
> 23: package org.openjdk.bench.java.lang.reflect.Proxy;

Package name needs to be lowercase. Not sure why the folder name is uppercase 
Proxy, but the two pre-existing benchmarks both have lower case package 
declarations. Uppercase letters in package names may subtly break a few tools

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1624270828


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v14]

2024-06-03 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> The generated proxy is migrated from static initialization to CONDY bootstrap.
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  ProxyGenBench simplification

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/834d65c5..7b00967d

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=13
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=12-13

  Stats: 44 lines in 1 file changed: 1 ins; 33 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v13]

2024-06-03 Thread Adam Sotona
On Mon, 3 Jun 2024 10:30:03 GMT, Claes Redestad  wrote:

>> Adam Sotona has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   added ProxyGenBench JMH micro benchmark
>
> test/micro/org/openjdk/bench/java/lang/reflect/Proxy/ProxyGenBench.java line 
> 66:
> 
>> 64: ClassDesc tempDesc = 
>> ClassDesc.ofDescriptor(Interfaze.class.descriptorString());
>> 65: loader = new ClsLoader();
>> 66: clsMap = new HashMap<>(100);
> 
> Suggestion:
> 
> clsMap = HashMap.newHashMap(100);

I've simplified it a lot. It uses a new `ClassLoader` instance for each proxy 
generation, instead of preparation of 100 different interfaces.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1624235034


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v13]

2024-06-03 Thread Claes Redestad
On Mon, 3 Jun 2024 10:11:34 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   added ProxyGenBench JMH micro benchmark

test/micro/org/openjdk/bench/java/lang/reflect/Proxy/ProxyGenBench.java line 66:

> 64: ClassDesc tempDesc = 
> ClassDesc.ofDescriptor(Interfaze.class.descriptorString());
> 65: loader = new ClsLoader();
> 66: clsMap = new HashMap<>(100);

Suggestion:

clsMap = HashMap.newHashMap(100);

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1624192732


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v13]

2024-06-03 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> The generated proxy is migrated from static initialization to CONDY bootstrap.
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  added ProxyGenBench JMH micro benchmark

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/942342d5..834d65c5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=12
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=11-12

  Stats: 114 lines in 1 file changed: 114 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v12]

2024-06-03 Thread Adam Sotona
On Wed, 29 May 2024 07:17:38 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains 13 additional 
> commits since the last revision:
> 
>  - obsolete import
>  - Merge branch 'master' into JDK-8332457-proxy-startup
>  - missing bracket
>  - Update src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java
>
>Co-authored-by: liach <7806504+li...@users.noreply.github.com>
>  - removed obsolete entry
>  - MTD_ cleanup
>  - fixed javadoc
>  - CONDY implementation of ProxyGenerator
>  - simplification of the proxy class loading
>  - more improvements
>  - ... and 3 more: https://git.openjdk.org/jdk/compare/2ed35129...942342d5

Added `ProxyGenBenchmark` measuring generation time of 100 proxies.
Results for master branch:

BenchmarkMode  Cnt   Score   Error  Units
Proxy.ProxyGenBench.generateProxiesss   10  12.266 ? 2.571  ms/op

Results for this PR:

BenchmarkMode  Cnt  Score   Error  Units
Proxy.ProxyGenBench.generateProxiesss   10  9.851 ? 2.424  ms/op

-

PR Comment: https://git.openjdk.org/jdk/pull/19410#issuecomment-2144806554


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v12]

2024-05-29 Thread Chen Liang
On Wed, 29 May 2024 07:17:38 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains 13 additional 
> commits since the last revision:
> 
>  - obsolete import
>  - Merge branch 'master' into JDK-8332457-proxy-startup
>  - missing bracket
>  - Update src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java
>
>Co-authored-by: liach <7806504+li...@users.noreply.github.com>
>  - removed obsolete entry
>  - MTD_ cleanup
>  - fixed javadoc
>  - CONDY implementation of ProxyGenerator
>  - simplification of the proxy class loading
>  - more improvements
>  - ... and 3 more: https://git.openjdk.org/jdk/compare/7a251c2c...942342d5

Shouldn't condy mainly benefit the cases where only some of the methods are 
called so the proxy doesn't have to initialize all methods with reflection, or 
the case where a proxy is created but none of its methods is called? Does it 
show a regression in those cases as well?

-

PR Comment: https://git.openjdk.org/jdk/pull/19410#issuecomment-2137366357


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v12]

2024-05-29 Thread Claes Redestad
On Wed, 29 May 2024 07:17:38 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains 13 additional 
> commits since the last revision:
> 
>  - obsolete import
>  - Merge branch 'master' into JDK-8332457-proxy-startup
>  - missing bracket
>  - Update src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java
>
>Co-authored-by: liach <7806504+li...@users.noreply.github.com>
>  - removed obsolete entry
>  - MTD_ cleanup
>  - fixed javadoc
>  - CONDY implementation of ProxyGenerator
>  - simplification of the proxy class loading
>  - more improvements
>  - ... and 3 more: https://git.openjdk.org/jdk/compare/62348071...942342d5

The condy bootstrapping adds a little noise when running this through an 
affected startup benchmark. Overall the net impact is small or even negative. 
This is a nice cleanup, though, but perhaps we ought to keep JDK-8332457 open 
(or file a new bug to keep investigating overheads).

-

PR Comment: https://git.openjdk.org/jdk/pull/19410#issuecomment-2137310415


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v12]

2024-05-29 Thread Chen Liang
On Wed, 29 May 2024 07:17:38 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains 13 additional 
> commits since the last revision:
> 
>  - obsolete import
>  - Merge branch 'master' into JDK-8332457-proxy-startup
>  - missing bracket
>  - Update src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java
>
>Co-authored-by: liach <7806504+li...@users.noreply.github.com>
>  - removed obsolete entry
>  - MTD_ cleanup
>  - fixed javadoc
>  - CONDY implementation of ProxyGenerator
>  - simplification of the proxy class loading
>  - more improvements
>  - ... and 3 more: https://git.openjdk.org/jdk/compare/19d52556...942342d5

Marked as reviewed by liach (Author).

-

PR Review: https://git.openjdk.org/jdk/pull/19410#pullrequestreview-2085154590


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v12]

2024-05-29 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> The generated proxy is migrated from static initialization to CONDY bootstrap.
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request with a new target base due to a merge 
or a rebase. The incremental webrev excludes the unrelated changes brought in 
by the merge/rebase. The pull request contains 13 additional commits since the 
last revision:

 - obsolete import
 - Merge branch 'master' into JDK-8332457-proxy-startup
 - missing bracket
 - Update src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java
   
   Co-authored-by: liach <7806504+li...@users.noreply.github.com>
 - removed obsolete entry
 - MTD_ cleanup
 - fixed javadoc
 - CONDY implementation of ProxyGenerator
 - simplification of the proxy class loading
 - more improvements
 - ... and 3 more: https://git.openjdk.org/jdk/compare/386e173f...942342d5

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/24b60451..942342d5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=11
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=10-11

  Stats: 4440 lines in 143 files changed: 3169 ins; 738 del; 533 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v11]

2024-05-28 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> The generated proxy is migrated from static initialization to CONDY bootstrap.
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  missing bracket

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/9ce8377c..24b60451

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=10
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=09-10

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v10]

2024-05-28 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> The generated proxy is migrated from static initialization to CONDY bootstrap.
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  Update src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java
  
  Co-authored-by: liach <7806504+li...@users.noreply.github.com>

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/b3f6be89..9ce8377c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=09
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=08-09

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v9]

2024-05-28 Thread Adam Sotona
On Tue, 28 May 2024 15:11:39 GMT, Chen Liang  wrote:

>> Adam Sotona has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   removed obsolete entry
>
> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 676:
> 
>> 674: toClassDesc(fromClass),
>> 675: method.getName(),
>> 676: 
>> MethodType.methodType(method.getReturnType(), 
>> method.getParameterTypes()).describeConstable().get()));
> 
> Suggestion:
> 
> desc);

good catch :)

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1617486750


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v9]

2024-05-28 Thread Chen Liang
On Tue, 28 May 2024 14:56:35 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   removed obsolete entry

src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 676:

> 674: toClassDesc(fromClass),
> 675: method.getName(),
> 676: 
> MethodType.methodType(method.getReturnType(), 
> method.getParameterTypes()).describeConstable().get()));

Suggestion:

desc);

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1617457062


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v9]

2024-05-28 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> The generated proxy is migrated from static initialization to CONDY bootstrap.
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  removed obsolete entry

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/fe596465..b3f6be89

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=08
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=07-08

  Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v8]

2024-05-28 Thread Chen Liang
On Tue, 28 May 2024 11:55:30 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY 
>> bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   MTD_ cleanup

Marked as reviewed by liach (Author).

-

PR Review: https://git.openjdk.org/jdk/pull/19410#pullrequestreview-2082875192


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v8]

2024-05-28 Thread Chen Liang
On Tue, 28 May 2024 11:55:30 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   MTD_ cleanup

Nice work migrating method object initialization to condy.

-

PR Comment: https://git.openjdk.org/jdk/pull/19410#issuecomment-2135212751


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v8]

2024-05-28 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  MTD_ cleanup

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/22e87768..fe596465

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=07
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=06-07

  Stats: 5 lines in 1 file changed: 3 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v7]

2024-05-28 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  fixed javadoc

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/c407e40e..22e87768

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=06
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=05-06

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v6]

2024-05-28 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  CONDY implementation of ProxyGenerator

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/3d975d28..c407e40e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=05
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=04-05

  Stats: 69 lines in 1 file changed: 8 ins; 39 del; 22 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v3]

2024-05-27 Thread Chen Liang
On Mon, 27 May 2024 16:08:04 GMT, Adam Sotona  wrote:

>> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 822:
>> 
>>> 820:.iconst_0() // false
>>> 821:.aload(0)// classLoader
>>> 822:.invokestatic(CD_Class, "forName", 
>>> MTD_Class_String_boolean_ClassLoader);
>> 
>> We can probably replace this `forName(name, false, thisClassLoader)` with 
>> loading a class constant to reduce load on symbols.
>
> I'm wondering why all the `Class.forName(... .getClassLoader())` 
> is necessary?
> Simple `ldc ` seems to work well.

Indeed, I initially added it because a JBS ticket recommended so. ldc 
instruction has the same behavior as such as forName call.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1616241702


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v3]

2024-05-27 Thread Adam Sotona
On Mon, 27 May 2024 12:24:31 GMT, Chen Liang  wrote:

>> Adam Sotona has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   performance improvements
>
> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 822:
> 
>> 820:.iconst_0() // false
>> 821:.aload(0)// classLoader
>> 822:.invokestatic(CD_Class, "forName", 
>> MTD_Class_String_boolean_ClassLoader);
> 
> We can probably replace this `forName(name, false, thisClassLoader)` with 
> loading a class constant to reduce load on symbols.

I'm wondering why all the `Class.forName(... .getClassLoader())` is 
necessary?
Simple `ldc ` seems to work well.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1616232095


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v5]

2024-05-27 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  simplification of the proxy class loading

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/eaf30201..3d975d28

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=04
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=03-04

  Stats: 60 lines in 1 file changed: 0 ins; 50 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v3]

2024-05-27 Thread Chen Liang
On Mon, 27 May 2024 11:47:15 GMT, Adam Sotona  wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
>> classfile API for reflection proxy-generation. Actual implementation of 
>> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
>> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
>> each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on 
>> performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   performance improvements

src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 76:

> 74: 
> 75: private static final MethodTypeDesc
> 76: MTD_boolean = MethodTypeDescImpl.ofValidated(CD_boolean, 
> ConstantUtils.EMPTY_CLASSDESC),

Maybe we can change the `MethodTypeDescImpl.ofValidated` to varargs so we don't 
need explicit array initializations.

src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 822:

> 820:.iconst_0() // false
> 821:.aload(0)// classLoader
> 822:.invokestatic(CD_Class, "forName", 
> MTD_Class_String_boolean_ClassLoader);

We can probably replace this `forName(name, false, thisClassLoader)` with 
loading a class constant to reduce load on symbols.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1615978269
PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1615982718


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v4]

2024-05-27 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  more improvements

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/29ca6a4e..eaf30201

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=03
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=02-03

  Stats: 14 lines in 1 file changed: 3 ins; 0 del; 11 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v3]

2024-05-27 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  performance improvements

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/1d4edea5..29ca6a4e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=02
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=01-02

  Stats: 77 lines in 2 files changed: 39 ins; 9 del; 29 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v2]

2024-05-27 Thread Adam Sotona
> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
> classfile API for reflection proxy-generation. Actual implementation of 
> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
> regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
> each proxy class is transformed from the template.
> 
> This patch is intended to examine plain proxy generation impact on 
> performance and JDK bootstrap (vs proxy transformation from template).
> 
> Please review.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  manual stack maps

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19410/files
  - new: https://git.openjdk.org/jdk/pull/19410/files/246efa11..1d4edea5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19410=01
 - incr: https://webrevs.openjdk.org/?repo=jdk=19410=00-01

  Stats: 39 lines in 1 file changed: 18 ins; 0 del; 21 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410


RFR: 8332457: Examine startup overheads from JDK-8294961

2024-05-27 Thread Adam Sotona
[JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use 
classfile API for reflection proxy-generation. Actual implementation of 
`ProxyGenerator` is focused on performance, however it causes JDK bootstrap 
regressions. `ProxyGenerator.TEMPLATE` class model is statically created and 
each proxy class is transformed from the template.

This patch is intended to examine plain proxy generation impact on performance 
and JDK bootstrap (vs proxy transformation from template).

Please review.

Thank you,
Adam

-

Commit messages:
 - 8332457: Examine startup overheads from JDK-8294961

Changes: https://git.openjdk.org/jdk/pull/19410/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk=19410=00
  Issue: https://bugs.openjdk.org/browse/JDK-8332457
  Stats: 233 lines in 1 file changed: 27 ins; 113 del; 93 mod
  Patch: https://git.openjdk.org/jdk/pull/19410.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19410/head:pull/19410

PR: https://git.openjdk.org/jdk/pull/19410