Removes unsafe access to private methods of MappedByteBuffer and RandomAccessFile
Using the get(int) method in a for loop is potentially slower than the (private) memory copy that we accessed previously. However, I took some performance measurements in my local wK on a SSD (admittedly not really representative, and very noisy). I could’t detect a systematic change, both the old and the new code loaded buckets to the browser at about 30MBit/s.
@youri-k Thanks for having a look! I agree that the signature is better with int (in fact it was already called with int only). Could you have another look?
Removes unsafe access to private methods of
MappedByteBuffer
andRandomAccessFile
Using the
get(int)
method in a for loop is potentially slower than the (private) memory copy that we accessed previously. However, I took some performance measurements in my local wK on a SSD (admittedly not really representative, and very noisy). I could’t detect a systematic change, both the old and the new code loaded buckets to the browser at about 30MBit/s.Java 13 introduces a new bulk get for MappedByteBuffers, which would have been ideal, but if we want compatibility for older Java versions we can’t use that (or have to have multiple builds, which seems nontrivial) https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/nio/ByteBuffer.html#get(int,byte%5B%5D,int,int)