[ https://issues.apache.org/jira/browse/IGNITE-25327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vladislav Pyatkov reassigned IGNITE-25327: ------------------------------------------ Assignee: Vladislav Pyatkov > 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 > Assignee: Vladislav Pyatkov > Priority: Major > Labels: ignite-3 > Time Spent: 10m > Remaining Estimate: 0h > > 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. Implementation notes > For extracting bytes from off-heap memory, use GridUnsafe. It ought to be > more productive than using DirectByteBuffer. > Fix it for {{BinaryTupleComparator}} and {{PartialBinaryTupleMatcher}}. > 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)