RFR: 8370822: Improve performance for MemorySegment::fill
Per Minborg
pminborg at openjdk.org
Fri Oct 31 09:22:01 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.
I ran some benchmarks and was unable to see any significant performance improvements. I ran on Linux (a64/x64), macOS a64, and Windows x64. Can you provide benchmarks that support this is a performance improvement?
| Benchmark | Linux aarch64 | Linux x64 | MacOSX aarch64 | Windows x64 |
| --- | --- | --- | --- | --- |
| openjdk.bench.java.lang.foreign.SegmentBulkFill.nativeSegmentFillJava-ELEM_SIZE:2 | -0.05% | -4.60% | -0.12% | -0.22% |
| openjdk.bench.java.lang.foreign.SegmentBulkFill.nativeSegmentFillJava-ELEM_SIZE:3 | -0.01% | -0.17% | -1.18% | 0.04% |
| openjdk.bench.java.lang.foreign.SegmentBulkFill.nativeSegmentFillJava-ELEM_SIZE:4 | -0.01% | 0.00% | -0.01% | 0.28% |
| openjdk.bench.java.lang.foreign.SegmentBulkFill.nativeSegmentFillJava-ELEM_SIZE:5 | 0.35% | -0.00% | 0.04% | 0.18% |
| openjdk.bench.java.lang.foreign.SegmentBulkFill.nativeSegmentFillJava-ELEM_SIZE:512 | -0.17% | -0.84% | 1.57% | -0.05% |
| openjdk.bench.java.lang.foreign.SegmentBulkFill.nativeSegmentFillJava-ELEM_SIZE:6 | 0.00% | 0.02% | -0.01% | 0.36% |
| openjdk.bench.java.lang.foreign.SegmentBulkFill.nativeSegmentFillJava-ELEM_SIZE:64 | -0.03% | -0.75% | -5.88% | -2.61% |
| openjdk.bench.java.lang.foreign.SegmentBulkFill.nativeSegmentFillJava-ELEM_SIZE:7 | -0.11% | -0.25% | -0.02% | 0.16% |
| openjdk.bench.java.lang.foreign.SegmentBulkFill.nativeSegmentFillJava-ELEM_SIZE:8 | -0.01% | -0.20% | -0.07% | 0.15% |
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28031#issuecomment-3472046372
More information about the core-libs-dev
mailing list