3 ms·
Right, I'm not talking about mapping or allocation costs or anything surrounding the access, just the impact of addressing off heap bytebuffers them seems quite
by marginalia_nu 3y ago
Right, I'm not talking about mapping or allocation costs or anything surrounding the access, just the impact of addressing off heap bytebuffers them seems quite a bit slower than what you get with the new foreign memory API... for whatever reason.
- xxs 3y agoYou mean using directBuffers in java - that could be, if the JIT fails to remove the bound checks. It should never be an issue in native code, of course. But yes - it's possible that it happens with Java code. In that case you'd need print assembly and looking at the generated code. Some libraries have 'switched' to straight unsafe use (which has no bound checks, of course), so there is that.
- bitcharmer 3y agoThis makes zero sense. I'll believe it when someone proves that (warmed up) direct byte buffer access is slower than Unsafe.
- marginalia_nu 3y agoI'm not comparing against Unsafe, this is JDK21. No unsafe anymore.