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

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Aug 28 11:49:25 UTC 2024


On Wed, 28 Aug 2024 09:06:48 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> then maybe a loop suffices and the code is simple?

We have tried a loop, but sadly the performance is not great if the number of iteration is small. This is due to the fact that long loops are split into two loops, and outer and an inner, where the inner loop works up to `Integer.MAX_SIZE`. While this strategy pays off for bigger iterations, it doesn't for very small ones. The C2 optimizations currently have a cutoff point, but it's possible that this point is set too high.

This is being discussed with @rwestrel

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

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


More information about the core-libs-dev mailing list