RFR: 8373256: [leyden] Pack DataKind more densely in archive
Spotting a little inefficiency when looking at related code. `DataKind` is always stored as `int`, but its values are actually comfortably fitting in byte. Going to `int8_t` saves about 1% of AOT cache size. If this ever becomes a problem, we can always revert back to `int32_t`. I looked around other uses of `write_bytes`, and I believe `DataKind` is the most obvious opportunity. Additional testing: - [x] Linux x86_64 server fastdebug, `runtime/cds` ------------- Commit messages: - Fix Changes: https://git.openjdk.org/leyden/pull/105/files Webrev: https://webrevs.openjdk.org/?repo=leyden&pr=105&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8373256 Stats: 23 lines in 2 files changed: 0 ins; 0 del; 23 mod Patch: https://git.openjdk.org/leyden/pull/105.diff Fetch: git fetch https://git.openjdk.org/leyden.git pull/105/head:pull/105 PR: https://git.openjdk.org/leyden/pull/105
On Mon, 8 Dec 2025 13:25:29 GMT, Aleksey Shipilev <shade@openjdk.org> wrote:
Spotting a little inefficiency when looking at related code. `DataKind` is always stored as `int`, but its values are actually comfortably fitting in byte. Going to `int8_t` saves about 1% of AOT cache size. If this ever becomes a problem, we can always revert back to `int32_t`. I looked around other uses of `write_bytes`, and I believe `DataKind` is the most obvious opportunity.
Additional testing: - [x] Linux x86_64 server fastdebug, `runtime/cds`
I don't think it is good optimization. The following data is assumed 4-bytes aligned when we read it. See `read_method()` and `read_klass()`. ------------- PR Review: https://git.openjdk.org/leyden/pull/105#pullrequestreview-3552662068
On Mon, 8 Dec 2025 15:33:31 GMT, Vladimir Kozlov <kvn@openjdk.org> wrote:
`read_method`
Oh. Yes, that makes sense. So we should actually go the other way around: assert that we never do unaligned reads, otherwise some platforms would give us performance surprises; if not UB. Let me go that way then. ------------- PR Comment: https://git.openjdk.org/leyden/pull/105#issuecomment-3627637306
On Mon, 8 Dec 2025 13:25:29 GMT, Aleksey Shipilev <shade@openjdk.org> wrote:
Spotting a little inefficiency when looking at related code. `DataKind` is always stored as `int`, but its values are actually comfortably fitting in byte. Going to `int8_t` saves about 1% of AOT cache size. If this ever becomes a problem, we can always revert back to `int32_t`. I looked around other uses of `write_bytes`, and I believe `DataKind` is the most obvious opportunity.
Additional testing: - [x] Linux x86_64 server fastdebug, `runtime/cds`
This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/leyden/pull/105
participants (3)
-
Aleksey Shipilev
-
duke
-
Vladimir Kozlov