RFR: 8370822: Improve performance for MemorySegment::fill

Igor Rudenko duke at openjdk.org
Mon Nov 3 10:08:33 UTC 2025


On Wed, 29 Oct 2025 00:01:57 GMT, Igor Rudenko <duke at openjdk.org> wrote:

> The manual byte-replication expression replaced with the multiplicative expansion trick - a more compact and efficient equivalent.

Some of existing key-tests:
[TestFill.java](https://github.com/openjdk/jdk/blob/deb7edb151fd5940fdf9fdb2a6356080ee94e222/test/jdk/java/foreign/TestFill.java#L51)
[TestSegments.java](https://github.com/openjdk/jdk/blob/deb7edb151fd5940fdf9fdb2a6356080ee94e222/test/jdk/java/foreign/TestSegments.java#L288)
[SegmentBulkFill.java](https://github.com/openjdk/jdk/blob/400f51f7ab19c2dc6a4195f78f9f815d03dd4434/test/micro/org/openjdk/bench/java/lang/foreign/SegmentBulkFill.java)

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

PR Comment: https://git.openjdk.org/jdk/pull/28031#issuecomment-3479746354


More information about the core-libs-dev mailing list