> The performance of the `MemorySegment::fil` can be improved by replacing the > `checkAccess()` method call with calling `checkReadOnly()` instead (as the > bounds of the segment itself do not need to be checked). > > Also, smaller segments can be handled directly by Java code rather than > transitioning to native code. > > Here is how the `MemorySegment::fill` performance is improved by this PR: > >  > > Operations involving 8 or more bytes are delegated to native code whereas > smaller segments are handled via a switch rake. > > It should be noted that `Arena::allocate` is using `MemorySegment::fil`. > Hence, this PR will also have a positive effect on memory allocation > performance.
Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Add a comment about the old switch type ------------- Changes: - all: https://git.openjdk.org/jdk/pull/20712/files - new: https://git.openjdk.org/jdk/pull/20712/files/da88ef77..81ed8cea Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=20712&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20712&range=01-02 Stats: 2 lines in 1 file changed: 1 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/20712.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20712/head:pull/20712 PR: https://git.openjdk.org/jdk/pull/20712