JackieTien97 opened a new pull request, #384:
URL: https://github.com/apache/tsfile/pull/384
1. Correct the retained size calculation for BinaryColumn and
BinaryColumnBuilder
2. remove some useless todo
3. throw new UnsupportedOperationException for isNull method in TimeColumn
Do the performance test, build 1 billion binary using TsBlockBuilder, we
only see 1-second performance impact(macOS M2 pro, OpenJDK-21).
Before:
6779
6420
6394
6387
6527
After:
7589
7524
8063
7592
7696
You can replay that test, using the following codes
```
public static void main(String[] args) {
TsBlockBuilder builder = new
TsBlockBuilder(Collections.singletonList(TSDataType.BLOB));
TimeColumnBuilder timeColumnBuilder = builder.getTimeColumnBuilder();
ColumnBuilder columnBuilder = builder.getColumnBuilder(0);
long startTime = System.nanoTime();
for (int i = 0; i < 1_000_000_000; i++) {
timeColumnBuilder.writeLong(i);
Binary binary = new Binary(BytesUtils.intToBytes(i));
columnBuilder.writeBinary(binary);
builder.declarePosition();
if (builder.isFull()) {
builder.build();
builder.reset();
timeColumnBuilder = builder.getTimeColumnBuilder();
columnBuilder = builder.getColumnBuilder(0);
}
}
if (!builder.isEmpty()) {
builder.build();
builder.reset();
}
System.out.println("cost: " + (System.nanoTime() - startTime) / 1_000_000);
}
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]