ClickHouse / clickhouse-java

ClickHouse Java Clients & JDBC Driver
https://clickhouse.com
Apache License 2.0
1.44k stars 530 forks source link

[client-v2] reader buffer optimization #1816

Closed chernser closed 2 weeks ago

chernser commented 2 weeks ago

Summary

A lot small buffers may be allocated while reading numeric information. This PR implements a reusing buffers withing a reader. It is not a default behavior. Introduced Client.Builder#allowBinaryReaderToReuseBuffers to control the behavior

Note:

Checklist

Delete items not relevant to your PR:

sonarcloud[bot] commented 2 weeks ago

Quality Gate Failed Quality Gate failed

Failed conditions
60.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

chernser commented 2 weeks ago

I do not see tests that enable the flag client_allow_binary_reader_to_reuse_buffers

I've added client-v2/src/test/java/com/clickhouse/client/query/BinaryReadyReusesBuffersTests.java that overrides QueryTests and sets client_allow_binary_reader_to_reuse_buffers