RFR: 8370822: Improve performance for MemorySegment::fill

Igor Rudenko duke at openjdk.org
Fri Oct 31 16:13:35 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.

Here is syntactic example 

Before
<img width="2413" height="902" alt="before" src="https://github.com/user-attachments/assets/3a1f83d0-be8a-48a5-a7e0-217334f01ac7" />

After
<img width="2413" height="902" alt="after" src="https://github.com/user-attachments/assets/ea062b60-8ad1-4572-9b3b-e7ef203065ee" />

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

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


More information about the core-libs-dev mailing list