ivandasch commented on a change in pull request #105:
URL: https://github.com/apache/ignite-3/pull/105#discussion_r619353670
##########
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:
I can send you my benchmarks. Yes, I agree that difference is
negligible. But I suppose, that ad-hoc is always worse than ready and
battle-tested implementation.Also var handle use `_putLongUnaligned` and
`_getLongUnaligned`.
By the way, why did you choose BIG_ENDIAN? As far as I remember,
LITTLE_ENDIAN is used widely in Ignite (i.e. thin client protocol).
--
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]