clickhouse-java
clickhouse-java copied to clipboard
[client-v2] Reduce number of allocations while compression/decompression data
Describe the bug
There is an issue with com.clickhouse.client.api.internal.ClickHouseLZ4OutputStream and com.clickhouse.client.api.internal.ClickHouseLZ4InputStream:
- new byte array created for each block
final byte[] block = new byte[compressedSizeWithHeader]; - uncompressed buffer is not cleared between interactions and causes extra allocation