You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladislav Pyatkov (Jira)" <ji...@apache.org> on 2025/05/07 11:23:00 UTC
[jira] [Created] (IGNITE-25327) Avoid copy bytes in tuple comparator
Vladislav Pyatkov created IGNITE-25327:
------------------------------------------
Summary: Avoid copy bytes in tuple comparator
Key: IGNITE-25327
URL: https://issues.apache.org/jira/browse/IGNITE-25327
Project: Ignite
Issue Type: Improvement
Reporter: Vladislav Pyatkov
h3. Motivation
We copy bytes from ByteBuffer each time when comparing any field in a tuple. The base is
{code:title=BinaryTupleParser}
private byte[] getBytes(int begin, int end) {
byte[] bytes = new byte[end - begin];
buffer.duplicate().position(begin).limit(end).get(bytes);
return bytes;
}
{code}
where we do a copy from the byte buffer. Then we compare fields by full deserialization value
{{BinaryTupleComparatorUtils#compareFieldValue}}.
We can avoid copying if we can compare the field data without deserialization in ByteBuffer directly using offset.
h3. Definition of done
Do a comparison without deserialization for all types for which it is advisable.
Binary comparison is certainly useful for {{STRING}} and {{BYTES}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)