buchireddy commented on a change in pull request #4362: Optimize
MutableOffHeapByteArrayStore by directly calling the PinotDataBuffer API
URL: https://github.com/apache/incubator-pinot/pull/4362#discussion_r297502034
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/io/writer/impl/MutableOffHeapByteArrayStore.java
##########
@@ -113,41 +106,41 @@ private int add(byte[] value) {
// full
return -1;
}
- for (int i = 0, j = startOffset; i < value.length; i++, j++) {
- _byteBuffer.put(j, value[i]);
- }
- _byteBuffer.putInt(_numValues * Integer.BYTES, startOffset);
+ _pinotDataBuffer.readFrom(startOffset, value);
Review comment:
I'm also curious if this gives performance improvement and how much. As per
the code in
`org.apache.pinot.core.segment.memory.PinotByteBuffer#readFrom(long, byte[],
int, int)`, if the buffer size is >10 (hard-coded value), the buffer is indeed
duplicated during the batch operation so there could be garbage impact too.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]