RFR: 8306842: Classfile API performance improvements [v8]
Adam Sotona
asotona at openjdk.org
Wed May 17 13:41:16 UTC 2023
> 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` and `MethodTypeEntry`
> - Caching `MethodTypeDesc` in `MethodInfo` implementations
> - `StackMapGenerator` and `Utils` delegating to cached `MethodTypeDesc` instead of custom parsing
>
> No API change.
>
> Benchmarks show stack map generation improved by 21% and code generation from symbols improved by 30%.
>
>
> Benchmark Mode Cnt Score Error Units
> GenerateStackMaps.benchmark thrpt 10 407931.202 ± 13101.023 ops/s
> RebuildMethodBodies.shared thrpt 4 10258.597 ± 383.699 ops/s
> RebuildMethodBodies.unshared thrpt 4 7224.543 ± 256.800 ops/s
>
>
>
> Benchmark Mode Cnt Score Error Units
> GenerateStackMaps.benchmark thrpt 10 495101.110 ± 2389.628 ops/s
> RebuildMethodBodies.shared thrpt 4 13380.272 ± 810.113 ops/s
> RebuildMethodBodies.unshared thrpt 4 9399.863 ± 557.060 ops/s
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:
# make/RunTests.gmk
# src/java.base/share/classes/jdk/internal/classfile/impl/Util.java
- LinkedList replaced with ArrayList in benchmarks
- Apply suggestions from code review
Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>
- changed LinkedList to ArrayList in RebuildMethodBodies benchmark
- added RepeatedModelTraversal JMH benchmark
- fixed jmh benchmark parameters
- fixed StackMapGenerator
- Apply suggestions from code review
Co-authored-by: liach <7806504+liach at users.noreply.github.com>
- Merge branch 'master' of https://github.com/openjdk/jdk into JDK-8306842-perf-improvements
# Conflicts:
# src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java
# src/java.base/share/classes/jdk/internal/classfile/impl/StackCounter.java
# src/java.base/share/classes/jdk/internal/classfile/impl/StackMapGenerator.java
# test/jdk/jdk/classfile/DiscontinuedInstructionsTest.java
# test/jdk/jdk/classfile/StackMapsTest.java
- more use of MethodInfo::methodTypeSymbol and faster ClassDesc slot size calculation
- ... and 24 more: https://git.openjdk.org/jdk/compare/5763be72...d99e7ad0
-------------
Changes: https://git.openjdk.org/jdk/pull/13671/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13671&range=07
Stats: 592 lines in 28 files changed: 386 ins; 90 del; 116 mod
Patch: https://git.openjdk.org/jdk/pull/13671.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/13671/head:pull/13671
PR: https://git.openjdk.org/jdk/pull/13671
More information about the core-libs-dev
mailing list