Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v6]

2021-11-23 Thread Vicente Romero
On Tue, 23 Nov 2021 15:05:47 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v6]

2021-11-23 Thread Claes Redestad
On Tue, 23 Nov 2021 15:05:47 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v6]

2021-11-23 Thread Vicente Romero
> Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much faster mainly because our implementation uses `String::format`.

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v5]

2021-11-22 Thread Vicente Romero
> Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much faster mainly because our implementation uses `String::format`.

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v4]

2021-11-22 Thread Vicente Romero
On Mon, 22 Nov 2021 15:53:53 GMT, Claes Redestad wrote: > FWIW I did a few experiments trying to move the chunking to `SCF`. Most made > things worse, but this is getting close: > https://github.com/openjdk/jdk/compare/master...cl4es:scf_split?expand=1 > > The threshold for when the JIT fails

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v3]

2021-11-22 Thread Vicente Romero
On Sat, 20 Nov 2021 12:10:40 GMT, Jim Laskey wrote: >> @stuart-marks yes, a general purpose splitting logic moved into the >> `StringConcatFactory` would be able to get rid of the arbitrary 200 slot >> limit (we would hit a harder but less arbitrary limit at around 253 instead). >> >> @JimLask

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v4]

2021-11-22 Thread Claes Redestad
On Mon, 22 Nov 2021 16:03:16 GMT, Jim Laskey wrote: >> src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line 314: >> >>> 312: ).getTarget(); >>> 313: mhs[splitIndex] = >>> MethodHandles.filterArguments(mhs[splitIndex], 0, currentSplitGette

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v4]

2021-11-22 Thread Vicente Romero
On Sun, 21 Nov 2021 00:29:46 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v4]

2021-11-22 Thread Jim Laskey
On Mon, 22 Nov 2021 15:56:46 GMT, Claes Redestad wrote: >> Vicente Romero has updated the pull request incrementally with one >> additional commit since the last revision: >> >> setting max split size to 20 > > src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line 314: > >> 3

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v4]

2021-11-22 Thread Claes Redestad
On Sun, 21 Nov 2021 00:29:46 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v4]

2021-11-22 Thread Claes Redestad
On Sun, 21 Nov 2021 00:29:46 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v4]

2021-11-22 Thread Jim Laskey
On Sun, 21 Nov 2021 00:29:46 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v4]

2021-11-20 Thread Vicente Romero
> Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much faster mainly because our implementation uses `String::format`.

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v3]

2021-11-20 Thread Vicente Romero
On Fri, 19 Nov 2021 05:07:23 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v3]

2021-11-20 Thread Jim Laskey
On Sat, 20 Nov 2021 11:31:41 GMT, Claes Redestad wrote: >> Regarding the slot limit in `StringConcatFactory`, it's not clear to me the >> limit of 200 is normative or is merely an implementation note. The limit of >> 200 slots seems to be arbitrary and shouldn't be baked into the spec. >> Perh

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v3]

2021-11-20 Thread PROgrm_JARvis
On Sat, 20 Nov 2021 04:40:22 GMT, Stuart Marks wrote: > Regarding the slot limit in `StringConcatFactory`, it's not clear to me the > limit of 200 is normative or is merely an implementation note. The limit of > 200 slots seems to be arbitrary and shouldn't be baked into the spec. Perhaps > th

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v3]

2021-11-20 Thread Claes Redestad
On Sat, 20 Nov 2021 04:40:22 GMT, Stuart Marks wrote: >> Vicente Romero has updated the pull request incrementally with one >> additional commit since the last revision: >> >> adding the benchmark > > Regarding the slot limit in `StringConcatFactory`, it's not clear to me the > limit of 200

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v3]

2021-11-20 Thread Jim Laskey
On Fri, 19 Nov 2021 05:07:23 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v3]

2021-11-19 Thread Stuart Marks
On Fri, 19 Nov 2021 05:07:23 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v3]

2021-11-19 Thread Claes Redestad
On Fri, 19 Nov 2021 05:12:25 GMT, Vicente Romero wrote: > It seems like the execution is way faster for these number of slots. I suggested this experiment to split up the concatenations more aggressively to diagnose if we're having an issue here where the performance of the method handle produ

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v3]

2021-11-18 Thread Vicente Romero
On Fri, 19 Nov 2021 05:28:10 GMT, Guoxiong Li wrote: > FYI: this patch also seems to solve > [JDK-8265747](https://bugs.openjdk.java.net/browse/JDK-8265747). yep, although I prefer to keep [JDK-8265747](https://bugs.openjdk.java.net/browse/JDK-8265747) because it is also referring to the hash

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v3]

2021-11-18 Thread Guoxiong Li
On Fri, 19 Nov 2021 05:07:23 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v3]

2021-11-18 Thread Vicente Romero
On Fri, 19 Nov 2021 05:07:23 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v3]

2021-11-18 Thread Vicente Romero
> Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much faster mainly because our implementation uses `String::format`.

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v2]

2021-11-18 Thread Сергей Цыпанов
On Wed, 17 Nov 2021 22:00:30 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v2]

2021-11-17 Thread Vicente Romero
On Wed, 17 Nov 2021 22:00:30 GMT, Vicente Romero wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved [v2]

2021-11-17 Thread Vicente Romero
> Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much faster mainly because our implementation uses `String::format`.

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved

2021-11-17 Thread PROgrm_JARvis
On Tue, 16 Nov 2021 05:24:38 GMT, Vicente Romero wrote: > Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much faste

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved

2021-11-17 Thread Vicente Romero
On Tue, 16 Nov 2021 05:24:38 GMT, Vicente Romero wrote: > Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much faste

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved

2021-11-16 Thread Claes Redestad
On Tue, 16 Nov 2021 05:24:38 GMT, Vicente Romero wrote: > Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much faste

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved

2021-11-16 Thread liach
On Tue, 16 Nov 2021 05:24:38 GMT, Vicente Romero wrote: > Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much faste

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved

2021-11-16 Thread Jim Laskey
On Tue, 16 Nov 2021 05:24:38 GMT, Vicente Romero wrote: > Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much faste

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved

2021-11-16 Thread Rémi Forax
On Tue, 16 Nov 2021 13:03:35 GMT, Jim Laskey wrote: >> (I'm not reviewer.) >> >> I think `.toArray(Class[]::new)` should be better here. `.toList` seems >> unnecessary. > > Class[] types = Stream.of(getters) > .map(g -> g.type().returnType()) > .toArray(Class[]::

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved

2021-11-16 Thread Jim Laskey
On Tue, 16 Nov 2021 10:36:46 GMT, Glavo wrote: >> src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line 264: >> >>> 262: .map(g -> g.type().returnType()) >>> 263: .toList() >>> 264: .toArray(new Class[getters.length]); >> >> Why no

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved

2021-11-16 Thread Glavo
On Tue, 16 Nov 2021 09:45:56 GMT, Сергей Цыпанов wrote: >> Please review this PR which aims to optimize the implementation of the >> `toString` method we provide for records. A benchmark comparing the >> implementation we are providing for records with lombok found out that >> lombok is much f

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved

2021-11-16 Thread Сергей Цыпанов
On Tue, 16 Nov 2021 05:24:38 GMT, Vicente Romero wrote: > Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much faste

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved

2021-11-15 Thread Aleksey Shipilev
On Tue, 16 Nov 2021 05:24:38 GMT, Vicente Romero wrote: > Please review this PR which aims to optimize the implementation of the > `toString` method we provide for records. A benchmark comparing the > implementation we are providing for records with lombok found out that lombok > is much faste