clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

[client-v2] Reduce number of allocations while compression/decompression data

Open chernser opened this issue 10 months ago • 0 comments

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

chernser avatar Feb 25 '25 00:02 chernser