RFR: 8365017: The SegmentBulkOperations::copy method can be improved using overlaps [v8]
Per Minborg
pminborg at openjdk.org
Wed Aug 13 14:21:23 UTC 2025
On Wed, 13 Aug 2025 14:14:30 GMT, Per Minborg <pminborg at openjdk.org> wrote:
>> This PR proposes to use overlapping memory areas in `SegmentBulkOperations::copy`, similar to what is proposed for `SegmentBulkOperations::fill` in https://github.com/openjdk/jdk/pull/25383.
>>
>> This PR passes `tier1`, `tier2`, and `tier3`testing on multiple platforms.
>
> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
>
> Break out the default branch
Viktor Klang suggested breaking out the default switch case in a separate conditional branch. This turned out to give better performance for sizes 16 bytes and upwards:
Bytes | Base | Patch | Improvement
-- | -- | -- | --
2 | 3.184 | 2.818 | 11.49%
3 | 3.162 | 2.822 | 10.75%
4 | 3.344 | 2.83 | 15.37%
5 | 3.31 | 2.819 | 14.83%
6 | 3.328 | 2.813 | 15.47%
7 | 3.289 | 2.826 | 14.08%
8 | 4.139 | 2.842 | 31.34%
12 | 4.709 | 2.848 | 39.52%
16 | 4.173 | 3.788 | 9.23%
24 | 4.239 | 3.89 | 8.23%
64 | 4.86 | 4.513 | 7.14%
<img width="824" height="505" alt="image" src="https://github.com/user-attachments/assets/2e25ac20-effc-4a44-8561-4ece0d6c609b" />
With this, I think we are good to go in terms of performance.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26672#issuecomment-3184127843
More information about the core-libs-dev
mailing list