carp84 commented on issue #9501: [FLINK-12697] [State Backends] Support on-disk 
state storage for spill-able heap backend
URL: https://github.com/apache/flink/pull/9501#issuecomment-544239753
 
 
   @StephanEwen here comes some more detailed response for the review questions:
   
   About the 2nd question about `unaligned` and its testing, from the [jdk 
source 
code](https://github.com/unofficial-openjdk/openjdk/blob/e87709def542f064a7ab9fa75542230e40876310/jdk/src/share/classes/java/nio/Bits.java#L611)
 and [os.name/os.arch mapping](http://lopica.sourceforge.net/os.html) we could 
know most of our tests actually fall into the `if (UNSAFE_UNALIGNED)` clause 
(also confirmed through test coverage tools), and the `else` clause calls 
`ByteBuffer.getXXX` method which JVM itself will assure the correctness, so I 
think we don't need to worry about the "dead path"
   
   About the 4th question, checking the [source code of 
DirectByteBuffer.getLong](https://github.com/Himansu-Nayak/java7-sourcecode/blob/329bbb33cbe8620aee3cee533eec346b4b56facd/java/nio/DirectByteBuffer.java#L753)
 we could know that it checks the `unaligned` and big/little endian again, so 
yes in our implementation way calling 
`UNSAFE.getLong(ByteBufferUtils.getBufferAddress(buf) + offset);` is really 
faster than `DirectByteBuffer.getLong(offset);`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to