RFR: 8338967: Improve performance for MemorySegment::fill [v5]

Per Minborg pminborg at openjdk.org
Wed Aug 28 09:10:24 UTC 2024


On Tue, 27 Aug 2024 20:25:46 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

> How fast do we need to be here given we are measuring in a few nanoseconds per operation?
> 
> What if the goal is not to regress from say explicitly filling in a small sized segment or a comparable array (e.g., < 8 bytes) then maybe a loop suffices and the code is simple?

Fair question. I have another version (called "patch bits" below) that is based on bit logic (first doing int ops, then short and lastly byte, similar to `ArraySupport::vectorizedMismatch`). This has slightly worse performance but is more scalable and perhaps simpler.

![image](https://github.com/user-attachments/assets/292c75aa-0df8-4bb7-b45f-426d0f8470d9)

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

PR Comment: https://git.openjdk.org/jdk/pull/20712#issuecomment-2314760835


More information about the core-libs-dev mailing list