question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Check if `*Unsafe*ByteBuf` makes still sense in java9+

See original GitHub issue

Java9 added more intrinsics for unaligned access which are part of jdk.internal.misc.Unsafe and so normally not accessible (note this is NOT sun.misc.Unsafe). With all of these new intrinsics its not clear anymore if having Unsafe ByteBuf implementations really give us any gain beside be able to access the memory address. We should do benchmarks and check if when using Java9 and later we should maybe better use the non Unsafe version while only allow to access the memory address if needed.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
normanmaurercommented, Sep 7, 2018

Let me close this… I will re-open another one for improvements if needed.

0reactions
normanmaurercommented, Sep 4, 2018

Did a few benchmarks and it seems like it still makes a lot of sense. We may be able to do some improvements tho. So let us keep this open.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Buffer vs Unsafe - Outside JVM - Stack Overflow
The first point where I think ByteBuffer wins over Unsafe is that ByteBuffer lets you add memory in a controlled fashion and has...
Read more >
Elimination of all ByteBuffer Usage (for Java 8) #132 - GitHub
That means a new memory manager to be based on using addresses instead of ByteBuffers and allocating the address from unsafe: Unsafe().allocateMemory(size);.
Read more >
Is using Unsafe really about speed or functionality?
If the difference is not compelling, using the simplest code possible makes more sense. i.e. using natural Java.
Read more >
Removal of Unsafe in Java 9 - A disaster in the making - Reddit
Project Jigsaw which modularizes the JDK will ship with 9 and will make it much harder (read impossible) for 3rd party code to...
Read more >
Need automated API compatibility check if compilation target ...
Let me re-check if I understand correctly: (1) The error occurs only if you compile against JRE 9 but run on JRE 7...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found