Home

Awesome

Benchmarks

Totally unscientific and mostly unrealistic benchmark that ClickHouse/ch-go project uses to understand performance.

The main goal is to measure minimal client overhead (CPU, RAM) to read data, i.e. data blocks deserialization and transfer.

Please see Notes for more details about results.

SELECT number FROM system.numbers_mt LIMIT 500000000
500000000 rows in set. Elapsed: 0.503 sec.
Processed 500.07 million rows,
  4.00 GB (993.26 million rows/s., 7.95 GB/s.)

Note: due to row-oriented design of most libraries, overhead per single row is significantly higher, so results can be slightly surprising.

NameTimeRAMRatio
ClickHouse/ch-go (Go)401ms9M~1x
clickhouse-client (C++)387ms91M~1x
vahid-sohrabloo/chconn (Go)472ms9M~1x
clickhouse-cpp (C++)516ms6.9M1.47x
clickhouse_driver (Rust)614ms9M1.72x
curl (C, HTTP)3.7s10M9x
clickhouse-client (Java, HTTP)6.4s121M16x
clickhouse-jdbc (Java, HTTP)7.2s120M18x
loyd/clickhouse.rs (Rust, HTTP)10s7.2M28x
uptrace (Go)122s13M55x
clickhouse-driver (Python)37s60M106x
ClickHouse/clickhouse-go (Go)146.8s23M117x
mailru/go-clickhouse (Go, HTTP)4m13s13M729x

See RESULTS.md and RESULTS.slow.md.

<sub> Keeping `ClickHouse/ch-go`, `clickhouse-client` and `vahid-sohrabloo/chconn` to `~1x`, they are mostly equal. </sub>

Notes

C++

CommandMean [ms]Min [ms]Max [ms]Relative
ClickHouse/ch-go598.8 ± 92.2356.9792.81.07 ± 0.33
clickhouse-client561.9 ± 149.5387.81114.21.00
clickhouse-cpp574.4 ± 35.9523.3707.41.02 ± 0.28

We are selecting best results, however C++ client has lower dispersion.

Maximum possible speed

I've measured my localhost performance using iperf3, getting 10 GiB/s, this correlates with top results.

For example, one of ClickHouse/ch-go results is 390ms 500000000 rows 4.0 GB 10 GB/s.

I've also implemented mock server in Go that simulates ClickHouse server to reduce overhead, because currently the main bottleneck in this test is server itself (and probably localhost). The ClickHouse/ch-go was able to achieve 257ms 500000000 rows 4.0 GB 16 GB/s which should be maximum possible burst result, but I'm not 100% sure.

On ClickHouse/ch-go micro-benchmarks I'm getting up to 27 GB/s, not accounting of any network overhead (i.e. inmemory).

Footnotes

  1. Uses reflection on row.Scan(&value) which causes additional overhead. 2