Re: RFR: 8306842: Classfile API performance improvements [v9]

2023-05-17 Thread Adam Sotona
> Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEntry` is caching `ClassDesc` symbol > - Caching of type symbols in `NameAndT

Re: RFR: 8306842: Classfile API performance improvements [v8]

2023-05-17 Thread Adam Sotona
On Wed, 17 May 2023 13:42:32 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 34 commits: >> >> - Merge branch 'master' into JDK-8306842-perf-improvements >> >># Conflicts: >># mak

Re: RFR: 8306842: Classfile API performance improvements [v8]

2023-05-17 Thread Chen Liang
On Wed, 17 May 2023 13:41:16 GMT, Adam Sotona wrote: >> Following improvements implemented: >> - Switch over `String` replaced with switch single char >> - Binary search for frames in `StackMapGenerator` >> - `StackMapGenerator.rawHandlers` with pre-calculated offsets >> - `ClassEntry` is caching

Re: RFR: 8306842: Classfile API performance improvements [v7]

2023-05-17 Thread Chen Liang
On Wed, 17 May 2023 13:28:53 GMT, Adam Sotona wrote: >> Good, I think it makes perfect sense for the MTD parameter list to be >> immutable and shareable without copying. > > Thank you for the review. > Yes, I'm looking forward to see it together with Constants API improvements > in one benchama

Re: RFR: 8306842: Classfile API performance improvements [v8]

2023-05-17 Thread Adam Sotona
> Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEntry` is caching `ClassDesc` symbol > - Caching of type symbols in `NameAndT

Re: RFR: 8306842: Classfile API performance improvements [v7]

2023-05-17 Thread Adam Sotona
On Tue, 16 May 2023 22:00:18 GMT, Claes Redestad wrote: >> I plan to share a backing list in #13186, with API additions so users can >> avoid copying their input immutable parameter list as well. I see no reason >> to use a direct array, for MTD is not passed to and used by the VM, unlike >> M

Re: RFR: 8306842: Classfile API performance improvements [v7]

2023-05-16 Thread Claes Redestad
On Tue, 16 May 2023 15:17:13 GMT, Chen Liang wrote: >> src/java.base/share/classes/jdk/internal/classfile/impl/StackMapDecoder.java >> line 83: >> >>> 81: vtis = new >>> VerificationTypeInfo[methodType.parameterCount()]; >>> 82: } >>> 83: for(var arg : methodType.pa

Re: RFR: 8306842: Classfile API performance improvements [v7]

2023-05-16 Thread Chen Liang
On Tue, 16 May 2023 14:23:04 GMT, Claes Redestad wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> LinkedList replaced with ArrayList in benchmarks > > src/java.base/share/classes/jdk/internal/classfile/impl/StackMapD

Re: RFR: 8306842: Classfile API performance improvements [v7]

2023-05-16 Thread Claes Redestad
On Tue, 16 May 2023 08:17:02 GMT, Adam Sotona wrote: >> Following improvements implemented: >> - Switch over `String` replaced with switch single char >> - Binary search for frames in `StackMapGenerator` >> - `StackMapGenerator.rawHandlers` with pre-calculated offsets >> - `ClassEntry` is caching

Re: RFR: 8306842: Classfile API performance improvements [v5]

2023-05-16 Thread Adam Sotona
On Mon, 15 May 2023 19:06:16 GMT, Glavo wrote: >> Adam Sotona has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - changed LinkedList to ArrayList in RebuildMethodBodies benchmark >> - added RepeatedModelTraversal JMH benchmark > > test/mi

Re: RFR: 8306842: Classfile API performance improvements [v7]

2023-05-16 Thread Adam Sotona
> Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEntry` is caching `ClassDesc` symbol > - Caching of type symbols in `NameAndT

Re: RFR: 8306842: Classfile API performance improvements [v4]

2023-05-16 Thread Adam Sotona
On Mon, 15 May 2023 17:04:54 GMT, Claes Redestad wrote: >> I'm not questioning performance differences between list implementations. >> The implementation of top level list for this benchmark is irrelevant >> because ~10ns difference cannot affect ~100µs benchmark run. > > Fair point. The only

Re: RFR: 8306842: Classfile API performance improvements [v6]

2023-05-16 Thread Adam Sotona
> Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEntry` is caching `ClassDesc` symbol > - Caching of type symbols in `NameAndT

Re: RFR: 8306842: Classfile API performance improvements [v5]

2023-05-15 Thread Andrey Turbanov
On Mon, 15 May 2023 14:48:58 GMT, Adam Sotona wrote: >> Following improvements implemented: >> - Switch over `String` replaced with switch single char >> - Binary search for frames in `StackMapGenerator` >> - `StackMapGenerator.rawHandlers` with pre-calculated offsets >> - `ClassEntry` is caching

Re: RFR: 8306842: Classfile API performance improvements [v5]

2023-05-15 Thread Glavo
On Mon, 15 May 2023 14:48:58 GMT, Adam Sotona wrote: >> Following improvements implemented: >> - Switch over `String` replaced with switch single char >> - Binary search for frames in `StackMapGenerator` >> - `StackMapGenerator.rawHandlers` with pre-calculated offsets >> - `ClassEntry` is caching

Re: RFR: 8306842: Classfile API performance improvements [v4]

2023-05-15 Thread Claes Redestad
On Mon, 15 May 2023 14:34:13 GMT, Adam Sotona wrote: >> I have to side with @liach here: `LinkedList` iteration is significantly >> slower than `ArrayList` even though the computational complexity is >> identical. Often by an integer factor. This is due to the sparseness of the >> linked list

Re: RFR: 8306842: Classfile API performance improvements [v5]

2023-05-15 Thread Adam Sotona
> Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEntry` is caching `ClassDesc` symbol > - Caching of type symbols in `NameAndT

Re: RFR: 8306842: Classfile API performance improvements [v4]

2023-05-15 Thread Adam Sotona
On Mon, 15 May 2023 13:42:05 GMT, Claes Redestad wrote: >> test/micro/org/openjdk/bench/jdk/classfile/RebuildMethodBodies.java line 57: >> >>> 55: public void setup() throws IOException { >>> 56: shared = new LinkedList<>(); >>> 57: unshared = new LinkedList<>(); >> >> Linke

Re: RFR: 8306842: Classfile API performance improvements [v4]

2023-05-15 Thread Claes Redestad
On Fri, 12 May 2023 13:19:44 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fixed jmh benchmark parameters > > test/micro/org/openjdk/bench/jdk/classfile/RebuildMethodBodies.java line 57: > >> 55:

Re: RFR: 8306842: Classfile API performance improvements [v4]

2023-05-15 Thread Adam Sotona
On Fri, 12 May 2023 13:19:44 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fixed jmh benchmark parameters > > test/micro/org/openjdk/bench/jdk/classfile/RebuildMethodBodies.java line 57: > >> 55:

Re: RFR: 8306842: Classfile API performance improvements [v4]

2023-05-12 Thread Chen Liang
On Wed, 10 May 2023 10:00:47 GMT, Adam Sotona wrote: >> Following improvements implemented: >> - Switch over `String` replaced with switch single char >> - Binary search for frames in `StackMapGenerator` >> - `StackMapGenerator.rawHandlers` with pre-calculated offsets >> - `ClassEntry` is caching

Re: RFR: 8306842: Classfile API performance improvements [v4]

2023-05-10 Thread Claes Redestad
On Wed, 10 May 2023 09:55:13 GMT, Adam Sotona wrote: >> That seems misplaced. Please file an RFE to have this cleaned up. >> >> Each microbenchmark that has to add opens needs to take responsibility for >> that themselves and not change the environment for everything else. And all >> micros t

Re: RFR: 8306842: Classfile API performance improvements [v4]

2023-05-10 Thread Adam Sotona
> Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEntry` is caching `ClassDesc` symbol > - Caching of type symbols in `NameAndT

Re: RFR: 8306842: Classfile API performance improvements [v4]

2023-05-10 Thread Adam Sotona
On Tue, 9 May 2023 16:15:27 GMT, Claes Redestad wrote: >> They are added in the `make/RunTests.gmk`: >> https://github.com/openjdk/jdk/pull/13550/files#diff-041bf69ea79b333b9ce99c1f879e398d698538530a35c361500b72631f059233R599-R608 > > That seems misplaced. Please file an RFE to have this cleaned

Re: RFR: 8306842: Classfile API performance improvements [v3]

2023-05-09 Thread Claes Redestad
On Tue, 9 May 2023 16:08:57 GMT, Chen Liang wrote: >> To make this runnable without manually adding a bunch of `--add-opens` flags > > They are added in the `make/RunTests.gmk`: > https://github.com/openjdk/jdk/pull/13550/files#diff-041bf69ea79b333b9ce99c1f879e398d698538530a35c361500b72631f05923

Re: RFR: 8306842: Classfile API performance improvements [v3]

2023-05-09 Thread Claes Redestad
On Tue, 9 May 2023 16:09:14 GMT, Adam Sotona wrote: >> Following improvements implemented: >> - Switch over `String` replaced with switch single char >> - Binary search for frames in `StackMapGenerator` >> - `StackMapGenerator.rawHandlers` with pre-calculated offsets >> - `ClassEntry` is caching

Re: RFR: 8306842: Classfile API performance improvements [v3]

2023-05-09 Thread Chen Liang
On Tue, 9 May 2023 15:57:44 GMT, Claes Redestad wrote: >> test/micro/org/openjdk/bench/jdk/classfile/RebuildMethodBodies.java line 42: >> >>> 40: @BenchmarkMode(Mode.Throughput) >>> 41: @State(Scope.Benchmark) >>> 42: @Fork(value = 1, jvmArgsAppend = {"--enable-preview"}) >> >> Suggestion: >>

Re: RFR: 8306842: Classfile API performance improvements [v3]

2023-05-09 Thread Claes Redestad
On Tue, 9 May 2023 15:50:30 GMT, Claes Redestad wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fixed StackMapGenerator > > test/micro/org/openjdk/bench/jdk/classfile/RebuildMethodBodies.java line 42: > >> 40: @Ben

Re: RFR: 8306842: Classfile API performance improvements [v3]

2023-05-09 Thread Adam Sotona
> Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEntry` is caching `ClassDesc` symbol > - Caching of type symbols in `NameAndT

Re: RFR: 8306842: Classfile API performance improvements [v2]

2023-05-09 Thread Adam Sotona
> Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEntry` is caching `ClassDesc` symbol > - Caching of type symbols in `NameAndT

Re: RFR: 8306842: Classfile API performance improvements

2023-05-09 Thread Chen Liang
On Wed, 26 Apr 2023 15:04:50 GMT, Adam Sotona wrote: > Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEntry` is caching `Cla

Re: RFR: 8306842: Classfile API performance improvements

2023-05-09 Thread Chen Liang
On Wed, 26 Apr 2023 15:04:50 GMT, Adam Sotona wrote: > Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEntry` is caching `Cla

Re: RFR: 8306842: Classfile API performance improvements

2023-05-09 Thread ExE Boss
On Wed, 26 Apr 2023 15:04:50 GMT, Adam Sotona wrote: > Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEntry` is caching `Cla

Re: RFR: 8306842: Classfile API performance improvements

2023-05-09 Thread Adam Sotona
On Wed, 26 Apr 2023 15:04:50 GMT, Adam Sotona wrote: > Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEntry` is caching `Cla

RFR: 8306842: Classfile API performance improvements

2023-05-09 Thread Adam Sotona
Following improvements implemented: - Switch over `String` replaced with switch single char - Binary search for frames in `StackMapGenerator` - `StackMapGenerator.rawHandlers` with pre-calculated offsets - `ClassEntry` is caching `ClassDesc` symbol - Caching of type symbols in `NameAndTypeEntry` an

Re: RFR: 8306842: Classfile API performance improvements

2023-05-09 Thread Adam Sotona
On Wed, 26 Apr 2023 16:00:07 GMT, Chen Liang wrote: > 1. CodeBuilder.invokeInstruction and CodeBuilder.fieldInstruction can pass > their symbols to the NameAndTypeEntry as well, since it's almost always going > to be used by stack map generation later. Yes, they actually do. CodeBuilder conven