RFR: 8345687: Improve the implementation of SegmentFactories::allocateSegment [v3]

Quan Anh Mai qamai at openjdk.org
Wed Dec 11 19:29:13 UTC 2024


> Hi,
> 
> This patch improves the performance of a typical `Arena::allocate` in several ways:
> 
> - Delay the creation of the NativeMemorySegmentImpl. This avoids the merge of the instance with the one obtained from the call in the uncommon path, increasing the chance the object being scalar replaced.
> - Split the allocation of over-aligned memory to a slow-path method.
> - Align the memory to 8 bytes, allowing faster zeroing.
> - Use a dedicated method to zero the just-allocated native memory, reduce code size and make it more straightforward.
> - Make `VM.pageAlignDirectMemory` a `Boolean` instead of a `boolean` so that `false` value can be constant folded.
> 
> Please take a look and leave your reviews, thanks a lot.

Quan Anh Mai has updated the pull request incrementally with two additional commits since the last revision:

 - wrong init
 - move segment instance creation to SegmentFactories

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/22610/files
  - new: https://git.openjdk.org/jdk/pull/22610/files/2661ff27..9654c322

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=22610&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22610&range=01-02

  Stats: 14 lines in 2 files changed: 6 ins; 4 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/22610.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22610/head:pull/22610

PR: https://git.openjdk.org/jdk/pull/22610


More information about the core-libs-dev mailing list