Skip to content

Commit 78793f0

Browse files
committed
merge main
1 parent 0d6fa7b commit 78793f0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

performance/src/test/com/clickhouse/benchmark/clients/Compression.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
public class Compression extends BenchmarkBase {
1515
private static final Logger LOGGER = LoggerFactory.getLogger(Compression.class);
1616

17+
static final int COMPRESS_BUFFER_SIZE = 64 * 1024; // 64K
18+
1719
@Benchmark
1820
public void CompressingOutputStreamV1(DataState dataState) {
1921
DataSet dataSet = dataState.dataSet;
2022
try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ClickHouseOutputStream out =
21-
new Lz4OutputStream(baos, 8196, null)) {
23+
new Lz4OutputStream(baos, COMPRESS_BUFFER_SIZE, null)) {
2224
for (byte[] bytes : dataSet.getBytesList(dataSet.getFormat())) {
2325
out.write(bytes);
2426
}
@@ -34,7 +36,7 @@ public void CompressingOutputStreamV2(DataState dataState) {
3436
DataSet dataSet = dataState.dataSet;
3537
try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
3638
ClickHouseLZ4OutputStream out = new ClickHouseLZ4OutputStream(baos,
37-
factory.fastCompressor(), 8196)) {
39+
factory.fastCompressor(), COMPRESS_BUFFER_SIZE)) {
3840
for (byte[] bytes : dataSet.getBytesList(dataSet.getFormat())) {
3941
out.write(bytes);
4042
}

0 commit comments

Comments
 (0)