Skip to content

Conversation

@raunaqmorarka
Copy link
Member

Description

Using this is unnecessary when creating output buffer for unbounded varchars

Benchmark                         (encoding)  (positionLength)     (type)   Mode  Cnt     Before Score      After Score Units
BenchmarkBinaryColumnReader.read       PLAIN     VARIABLE_0_10  UNBOUNDED  thrpt   40  105.665 ± 0.948  113.374 ± 1.893 ops/s

Additional context and related issues

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

Using this is unnecessary when creating output buffer for unbounded varchars

Benchmark                         (encoding)  (positionLength)     (type)   Mode  Cnt     Before Score      After Score Units
BenchmarkBinaryColumnReader.read       PLAIN     VARIABLE_0_10  UNBOUNDED  thrpt   40  105.665 ± 0.948  113.374 ± 1.893 ops/s
@raunaqmorarka raunaqmorarka merged commit bf8eca7 into trinodb:master Dec 2, 2024
58 checks passed
@raunaqmorarka raunaqmorarka deleted the pqr-string branch December 2, 2024 10:05
@github-actions github-actions bot added this to the 467 milestone Dec 2, 2024
* Create one big slice of data and add it to the output buffer since buffer size is known.
* Specialized for the case of strings with no truncation
*/
private static Slice createOutputBuffer(int[] offsets, int offset, int length, Slice inputSlice, int outputBufferSize)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so offsets have double meaning? As in it's length as out it's offset? Would be good to have that commented

int positionLength = offsets[offset + i + 1];
arraycopy(inputArray, inputArrayOffset + currentInputOffset + Integer.BYTES, outputBuffer, currentOutputOffset, positionLength);
offsets[offset + i + 1] = offsets[offset + i] + positionLength;
currentInputOffset += positionLength + Integer.BYTES;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add BYTES here and in arraycopy? Just add BYTES * 2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants