[foreign-memaccess+abi] RFR: 8311594: Avoid GlobalSession liveness check [v2]
Maurizio Cimadamore
mcimadamore at openjdk.org
Tue Jul 11 09:26:20 UTC 2023
On Tue, 11 Jul 2023 00:58:56 GMT, Brian S. O'Neill <duke at openjdk.org> wrote:
> So what's the next step?
I believe the next best step is to try and determine exactly where the 2-3% performance regression comes from. We have many benchmarks that show no extra cost compared with unsafe if access occurs in a counted loop (because most we made sure that all checks can be hoisted outside the loop). But we need to be able to isolate the access pattern that is causing issue: does your code have a lot of "lone" reads/writes scattered through the code not surrounded by any loop? Or, maybe the loop is there, but for some reason the JIT is failing to hoist some of the checks? Or maybe a failure to vectorize the loop accordingly? These are very different problems - with the latter two probably more fixable (either with some changes in your code, on in our VM optimization logic) than the first (a **single** memory access using MemorySegment, ByteBuffer or any other API which enforces some extra checks is always going to be slower than same access using Unsafe). But loop-access is, typically, where t
he big wins are performance-wise, with potential for check hoisting, vectorization, and more.
-------------
PR Review Comment: https://git.openjdk.org/panama-foreign/pull/844#discussion_r1259463453
More information about the panama-dev
mailing list