[External] : Re: MemorySegment.ofAddress(...).reinterpret(...)
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Mon Jul 10 15:06:40 UTC 2023
On 10/07/2023 15:33, Brian S O'Neill wrote:
> I question the effectiveness of inlining. In a micro benchmark, full
> inlining is easy to observe. But in something more complex, how can I
> be certain that inlining is working? I don't have the luxury of using
> the ForceInline annotation myself. I can enable logging to observe
> inlining actions, but the application is quite complex, and this
> generates a unending stream of noise.
As I said, I think we need to be able to reproduce the results in order
to have a better idea of what could be going wrong here.
As Jorn pointed out, calls to MemorySegment::get/set are guaranteed to
always inline effectively, but that of course depends on whether your
code path is "hot" (but if changing the code results in some visible
differences, that should be the case, unless your measurement is
affected by non-trivial warm up behavior).
If there is a specific method you are worried about, typically the best
thing to do would be to look at -XX:+PrintInlining, and then look for
the lines associated with that method, and see if something failed to
inline. But it can be a tedious process, which is why I'm recommending
for you to isolate some kind of test case that we could look into.
Cheers
Maurizio
More information about the panama-dev
mailing list