RFR: 8253525: Implement getInstanceSize/sizeOf intrinsics [v6]
Aleksey Shipilev
shade at openjdk.java.net
Tue Nov 10 12:04:21 UTC 2020
> This is fork off the SizeOf JEP, JDK-8249196. There is already the entry point in JDK that can use the intrinsic like this: `Instrumentation.getInstanceSize`. Therefore, we can implement the C1/C2 intrinsic now, hook it up to `Instrumentation`, and let the tools use that fast path today.
>
> With this patch, JOL is able to be close to `deepSizeOf` implementation from SizeOf JEP.
>
> Example performance improvements for sizing up a custom linked list:
>
> Benchmark (size) Mode Cnt Score Error Units
>
> # Default
> LinkedChainBench.linkedChain 1 avgt 5 705.835 ± 8.051 ns/op
> LinkedChainBench.linkedChain 10 avgt 5 3148.874 ± 37.856 ns/op
> LinkedChainBench.linkedChain 100 avgt 5 28693.256 ± 142.254 ns/op
> LinkedChainBench.linkedChain 1000 avgt 5 290161.590 ± 4594.631 ns/op
>
> # Instrumentation attached, no intrinsics
> LinkedChainBench.linkedChain 1 avgt 5 159.659 ± 19.238 ns/op
> LinkedChainBench.linkedChain 10 avgt 5 717.659 ± 22.540 ns/op
> LinkedChainBench.linkedChain 100 avgt 5 7739.394 ± 111.683 ns/op
> LinkedChainBench.linkedChain 1000 avgt 5 80724.238 ± 2887.794 ns/op
>
> # Instrumentation attached, new intrinsics
> LinkedChainBench.linkedChain 1 avgt 5 95.254 ± 0.808 ns/op
> LinkedChainBench.linkedChain 10 avgt 5 261.564 ± 8.524 ns/op
> LinkedChainBench.linkedChain 100 avgt 5 3367.192 ± 21.128 ns/op
> LinkedChainBench.linkedChain 1000 avgt 5 34148.851 ± 373.080 ns/op
Aleksey Shipilev 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 eight additional commits since the last revision:
- Trim down the iteration count, and use -Xbatch to wait for compilation
- Use proper constant names in the test
- Merge branch 'master' into JDK-8253525-sizeof-intrinsics
- The new intrinsic-related test
- Revert the change to test
- Merge branch 'master' into JDK-8253525-sizeof-intrinsics
- Add new intrinsics to toBeInvestigated list in CheckGraalIntrinsics.java
- 8253525: Implement getInstanceSize/sizeOf intrinsics
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/650/files
- new: https://git.openjdk.java.net/jdk/pull/650/files/482c2f24..1b7290a3
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=650&range=05
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=650&range=04-05
Stats: 138167 lines in 1930 files changed: 82950 ins; 42900 del; 12317 mod
Patch: https://git.openjdk.java.net/jdk/pull/650.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/650/head:pull/650
PR: https://git.openjdk.java.net/jdk/pull/650
More information about the serviceability-dev
mailing list