{"id":20102543,"url":"https://github.com/clickhouse/ch-bench","last_synced_at":"2025-05-06T08:30:47.127Z","repository":{"id":38329049,"uuid":"438001215","full_name":"ClickHouse/ch-bench","owner":"ClickHouse","description":"Benchmarks for ch","archived":false,"fork":false,"pushed_at":"2024-03-04T21:42:56.000Z","size":162,"stargazers_count":30,"open_issues_count":5,"forks_count":9,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-09T10:12:18.393Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ClickHouse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-13T19:35:43.000Z","updated_at":"2024-07-14T07:03:55.000Z","dependencies_parsed_at":"2024-11-13T17:35:38.702Z","dependency_job_id":"a1089993-46e4-493c-a376-53d290111f31","html_url":"https://github.com/ClickHouse/ch-bench","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fch-bench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fch-bench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fch-bench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fch-bench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClickHouse","download_url":"https://codeload.github.com/ClickHouse/ch-bench/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252648449,"owners_count":21782391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T17:31:39.515Z","updated_at":"2025-05-06T08:30:46.840Z","avatar_url":"https://github.com/ClickHouse.png","language":"Go","readme":"# Benchmarks\n\nTotally **unscientific** and mostly unrealistic benchmark that\n[ClickHouse/ch-go][ch] project uses to understand performance.\n\nThe main goal is to measure minimal **client overhead** (CPU, RAM) to read data,\ni.e. data blocks deserialization and transfer.\n\nPlease see [Notes](#Notes) for more details about results.\n\n```sql\nSELECT number FROM system.numbers_mt LIMIT 500000000\n```\n```\n500000000 rows in set. Elapsed: 0.503 sec.\nProcessed 500.07 million rows,\n  4.00 GB (993.26 million rows/s., 7.95 GB/s.)\n```\n\nNote: due to row-oriented design of most libraries, overhead per single row\nis significantly higher, so results can be slightly surprising.\n\n\n| Name                                          | Time  | RAM  | Ratio |\n|-----------------------------------------------|-------|------|-------|\n| **[ClickHouse/ch-go][ch]** (Go)               | 401ms | 9M   | ~1x   |\n| [clickhouse-client][client] (C++)             | 387ms | 91M  | ~1x   |\n| [vahid-sohrabloo/chconn][vahid] (Go)          | 472ms | 9M   | ~1x   |\n| [clickhouse-cpp][cpp] (C++)                   | 516ms | 6.9M | 1.47x |\n| [clickhouse_driver][rs] (Rust)                | 614ms | 9M   | 1.72x |\n| [curl][curl] (C, HTTP)                        | 3.7s  | 10M  | 9x    |\n| [clickhouse-client][java] (Java, HTTP)        | 6.4s  | 121M | 16x   |\n| [clickhouse-jdbc][jdbc] (Java, HTTP)          | 7.2s  | 120M | 18x   |\n| [loyd/clickhouse.rs][rs-http] (Rust, HTTP)    | 10s   | 7.2M | 28x   |\n| [uptrace][uptrace] (Go)[^reflect]             | 22s   | 13M  | 55x   |\n| [clickhouse-driver][py] (Python)              | 37s   | 60M  | 106x  |\n| [ClickHouse/clickhouse-go][go] (Go)[^reflect] | 46.8s | 23M  | 117x  |\n| [mailru/go-clickhouse][mail] (Go, HTTP)       | 4m13s | 13M  | 729x  |\n\n[^reflect]: Uses reflection on `row.Scan(\u0026value)` which causes additional overhead.\n\n[client]:  https://clickhouse.com/docs/en/interfaces/cli/ \"Native command-line client (Official)\"\n[ch]:      https://github.com/ClickHouse/ch-go \"ClickHouse/ch-go\"\n[rs]:      https://github.com/datafuse-extras/clickhouse_driver \"datafuse-extras/clickhouse_driver\"\n[rs-http]: https://github.com/loyd/clickhouse.rs \"A typed client for ClickHouse (HTTP)\"\n[cpp]:     https://github.com/ClickHouse/clickhouse-cpp \"C++ client library for ClickHouse (Official)\"\n[curl]:    https://github.com/curl/curl \"A command-line tool for transferring data specified with URL syntax\"\n[vahid]:   https://github.com/vahid-sohrabloo/chconn \"Low-level ClickHouse database driver for Golang\"\n[java]:    https://github.com/ClickHouse/clickhouse-jdbc/tree/develop/clickhouse-client \"Java client for ClickHouse (Official)\"\n[jdbc]:    https://github.com/ClickHouse/clickhouse-jdbc/tree/develop/clickhouse-jdbc \"JDBC driver for ClickHouse (Official)\"\n[py]:      https://github.com/mymarilyn/clickhouse-driver\n[go]:      https://github.com/ClickHouse/clickhouse-go \"Golang driver for ClickHouse (Official)\"\n[mail]:    https://github.com/mailru/go-clickhouse \"Golang SQL database driver (HTTP, TSV format)\"\n[uptrace]: https://github.com/uptrace/go-clickhouse \"ClickHouse client for Go 1.18+ (Uptrace)\"\n\nSee [RESULTS.md](./RESULTS.md) and [RESULTS.slow.md](./RESULTS.slow.md).\n\n\u003csub\u003e\nKeeping `ClickHouse/ch-go`, `clickhouse-client` and `vahid-sohrabloo/chconn` to `~1x`, they are mostly equal.\n\u003c/sub\u003e\n\n## Notes\n\n### C++\n\n| Command             |     Mean [ms] | Min [ms] | Max [ms] |    Relative |\n|:--------------------|--------------:|---------:|---------:|------------:|\n| `ClickHouse/ch-go`  |  598.8 ± 92.2 |    356.9 |    792.8 | 1.07 ± 0.33 |\n| `clickhouse-client` | 561.9 ± 149.5 |    387.8 |   1114.2 |        1.00 |\n| `clickhouse-cpp`    |  574.4 ± 35.9 |    523.3 |    707.4 | 1.02 ± 0.28 |\n\n\nWe are selecting **best** results, however C++ client has lower dispersion.\n\n# Maximum possible speed\n\nI've measured my localhost performance using `iperf3`, getting 10 GiB/s,\nthis correlates with top results.\n\nFor example, one of [ClickHouse/ch-go][ch] results is `390ms 500000000 rows 4.0 GB 10 GB/s`.\n\nI've also implemented [mock server in Go](https://github.com/ClickHouse/ch-go/blob/main/internal/cmd/ch-bench-server/main.go) that simulates ClickHouse server to reduce\noverhead, because currently the main bottleneck in this test is server itself (and probably localhost).\nThe [ClickHouse/ch-go][ch]  was able\nto achieve `257ms 500000000 rows 4.0 GB 16 GB/s` which should be maximum\npossible burst result, but I'm not 100% sure.\n\nOn [ClickHouse/ch-go][ch] micro-benchmarks I'm getting up to 27 GB/s, not accounting of any\nnetwork overhead (i.e. inmemory).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclickhouse%2Fch-bench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclickhouse%2Fch-bench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclickhouse%2Fch-bench/lists"}