[foreign-memaccess+abi] RFR: Add benchmarks to MemorySegmentVsBits

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Jan 3 21:36:14 UTC 2023


On Tue, 3 Jan 2023 21:20:34 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> > > All checks are hoisted out of the hot loop - so in principle the segment code should vectorize as well?
> > 
> > 
> > The addressing modes of loads from the long array and stores to the underlying memory are slightly different, but connected via the loop variable. I wonder if additional layers involved with memory segments means C2 is loosing that information, which makes the auto-vectorizer bail out.
> 
> I thought of that - but not sure why the buffer benchmark is also slow - heap buffers are implemented using array access aren't they?

Nevermind - in both ByteBuffer and LongBuffer cases, access should occur with Unsafe::getLongUnaligned. Which makes the difference even more puzzling (since the former seems slower than the latter).

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

PR: https://git.openjdk.org/panama-foreign/pull/762


More information about the panama-dev mailing list