ivandasch commented on a change in pull request #105:
URL: https://github.com/apache/ignite-3/pull/105#discussion_r619347727



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
##########
@@ -167,4 +167,63 @@ public static int hash(long key) {
 
         return hash(val);
     }
+
+    /**
+     * Constructs {@code long} from byte array.
+     *
+     * @param bytes Array of bytes.
+     * @param off Offset in {@code bytes} array.
+     * @return Long value.
+     */
+    public static long bytesToLong(byte[] bytes, int off) {

Review comment:
       ```
   Benchmark                                 Mode  Cnt   Score   Error  Units
   BytesLongBenchmark.bytesToLongByteBuffer  avgt   10   4.173 ± 0.168  ns/op
   BytesLongBenchmark.bytesToLongCycle       avgt   10   6.716 ± 0.137  ns/op
   BytesLongBenchmark.bytesToLongUnroll      avgt   10   6.476 ± 0.166  ns/op
   BytesLongBenchmark.bytesToLongVarHandle   avgt   10   4.879 ± 0.190  ns/op
   BytesLongBenchmark.longToBytesByteBuffer  avgt   10   7.691 ± 0.245  ns/op
   BytesLongBenchmark.longToBytesCycle       avgt   10  10.436 ± 0.386  ns/op
   BytesLongBenchmark.longToBytesUnroll      avgt   10   9.716 ± 0.380  ns/op
   BytesLongBenchmark.longToBytesVarHandle   avgt   10   7.779 ± 0.205  ns/op
   ```
   
   




-- 
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]


Reply via email to