File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
performance/src/test/com/clickhouse/benchmark/clients Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1414public 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 }
You can’t perform that action at this time.
0 commit comments