Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v3]

2022-05-18 Thread Сергей Цыпанов
On Mon, 16 May 2022 15:29:38 GMT, Сергей Цыпанов wrote: >> Even in the no exceptions case, the `exceptionTypes` array still has to be  >> allocated/copied by `Method.getExceptionTypes()`[^1] when the `ProxyMethod`  >> constructor[^2] is invoked. >> >> So if anything, the `List.of(…)` call

Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v3]

2022-05-16 Thread Сергей Цыпанов
On Fri, 13 May 2022 13:36:52 GMT, ExE Boss wrote: > So if anything, the List.of(…) call should be moved into the ProxyMethod > constructor. And maybe the call to Method.getExceptionTypes() should be > changed to Method.getSharedExceptionTypes() Makes sense. Do you want me to do this within

Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v3]

2022-05-13 Thread ExE Boss
On Fri, 13 May 2022 12:19:25 GMT, Сергей Цыпанов wrote: >> Usually a method declares either no exception, or a couple of them. In the >> first case `List.of()` doesn't allocate, in the second it allocates an >> object with 1-2 fields but without an array, so `List.of()` is likely to be >>

Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v3]

2022-05-13 Thread Сергей Цыпанов
On Fri, 13 May 2022 11:14:29 GMT, ExE Boss wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8282662: Revert dubious changes in MethodType > > src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line

Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v3]

2022-05-13 Thread Сергей Цыпанов
On Fri, 13 May 2022 12:19:08 GMT, Сергей Цыпанов wrote: >> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 727: >> >>> 725: MethodVisitor mv = cw.visitMethod(accessFlags, >>> 726: method.getName(), desc, null, >>> 727:

Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v3]

2022-05-13 Thread ExE Boss
On Thu, 10 Mar 2022 08:52:17 GMT, Сергей Цыпанов wrote: >> `List.of()` along with `Set.of()` create unmodifiable `List/Set` but with >> smaller footprint comparing to `Arrays.asList()` / `new HashSet()` when >> called with vararg of size 0, 1, 2. >> >> In general replacement of

Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v3]

2022-05-13 Thread Сергей Цыпанов
On Thu, 12 May 2022 14:14:38 GMT, Weijun Wang wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8282662: Revert dubious changes in MethodType > >

Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v3]

2022-05-12 Thread Weijun Wang
On Thu, 10 Mar 2022 08:52:17 GMT, Сергей Цыпанов wrote: >> `List.of()` along with `Set.of()` create unmodifiable `List/Set` but with >> smaller footprint comparing to `Arrays.asList()` / `new HashSet()` when >> called with vararg of size 0, 1, 2. >> >> In general replacement of

Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v3]

2022-04-26 Thread Сергей Цыпанов
On Thu, 10 Mar 2022 08:52:17 GMT, Сергей Цыпанов wrote: >> `List.of()` along with `Set.of()` create unmodifiable `List/Set` but with >> smaller footprint comparing to `Arrays.asList()` / `new HashSet()` when >> called with vararg of size 0, 1, 2. >> >> In general replacement of

Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v3]

2022-03-29 Thread Сергей Цыпанов
On Sat, 26 Mar 2022 16:35:14 GMT, liach wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8282662: Revert dubious changes in MethodType > > Just curious, this issue asks to replace set constructions with `Set.of`,