You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update ClickBench benchmarks with DataFusion 43.0.0 #13099
Once DataFusion 43.0.0 is released, It would be great to update ClickBench https://benchmark.clickhouse.com/ with runs from the latest version. It looks like we are still reporting numbers for DataFusion 40 and there have been significant improvements since then. See for more details:
We will also need to update DataFusion to apply the new binary_as_string option added by @goldmedal in #12816. TLDR is that we need to update the create table statements to have the OPTIONS ('binary_as_string' 'true') clause
changed the title [-]Update ClickBench benchmarks with DataFusion `43.0.0[/-][+]Update ClickBench benchmarks with DataFusion `43.0.0`[/+]on Oct 24, 2024
I just double checked and this should be good to go now -- the clickbench runner uses datafusion-cli rather than the python bindings (which haven't yet released a version 43.0.0)
It is sad that we are not yet the fastest engine but interestingly it looks like many places where we are the farthest from the top are the really fast queries (that take 100s of ms)
It is sad that we are not yet the fastest engine but interestingly it looks like many places where we are the farthest from the top are the really fast queries (that take 100s of ms)
That's an interesting observation. Maybe we can look at benchmarking on c6a.metal at some point - it might highlight some more areas which could be improved and would show how DataFusion scales out to 192 vCPUs
After profiling, I believe we still can get obvious improvement after finishing #11943 and its related epic!
Indeed. I also wanted to point out that item did not make it into 43.0.0 (it was merged shortly after we made the release candidate) so I expect the 44.0.0 release to be even better
Polars is included in the benchmark (via in memory DataFrame API) and runs on the biggest machine.
It seems DataFusion is faster on quite some queries even though it reads parquet from disk and runs on a smaller machine.
This is quite interesting. It seems like Polars may also compute min/max/count/sum during load as some queries take 0 time (but there is 275s of load time).
Still 🎣 this would be an excellent optimization for anyone else working on
The polars test is in python so I don't think that is a fair comparison
I don't think that's very relevant, as the execution is done natively (Polars is written in Rust). Likewise, DataFusion also would perform about the same in Python.
Running on the biggest machine / and / or reading everything in memory actually gives Polars an advantage, so I think it’s even more impressive to see the difference here.
I think it mainly shows the different optimizations done last ~2 years to make (tricky/expensive) aggregations fast. It may also show some problems in Polars, e.g. with compiling regexes.
I'm very pleased to see DataFusion achieving such results. However, I encountered some anomalies while trying to reproduce the benchmark, so I'd like to ask for some guidance.
Following the scripts in the ClickBench repository, I ran ClickBench on partitioned parquet files.
During the cold run phase, DataFusion was about 20% faster than ClickHouse, but in the hot run phase, DataFusion was about 20% slower than ClickHouse.
We used a machine with specifications similar to c6a.4xlarge, featuring 16 vCPUs, 32GB of memory, and an SSD with 2GB/s bandwidth. Additionally, we ran ClickBench on a machine with similar specifications but using HDD, and the results were consistent - DataFusion was slower than ClickHouse in the hot run phase.
This was quite unexpected, and I'd like to know if there might be some configuration/compilation parameters that could be causing this issue.
@alamb I would really appreciate any advice you could give when you have a moment.
@alamb I would really appreciate any advice you could give when you have a moment.
I think we would have to get some detailed profiling to really know for sure, but I suspect that ClickBench has non trivial caches (buffer caching, page caches, etc)
DataFusion, as a serverless engine, does not have any such caching (the only difference between cold/hot run is that on the hot run, data from disk will be in the Linux page cache (so may not do any actual IO)
It might also help to break down which queries showed the biggest discrepancy -- were they queries that already ran in 100ms (in which case caching , avoiding re-reading metadata might be a bigger part of processing)
@alamb I would really appreciate any advice you could give when you have a moment.
I think we would have to get some detailed profiling to really know for sure, but I suspect that ClickBench has non trivial caches (buffer caching, page caches, etc)
DataFusion, as a serverless engine, does not have any such caching (the only difference between cold/hot run is that on the hot run, data from disk will be in the Linux page cache (so may not do any actual IO)
It might also help to break down which queries showed the biggest discrepancy -- were they queries that already ran in 100ms (in which case caching , avoiding re-reading metadata might be a bigger part of processing)
For parquet files, ClickHouse uses local mode. In my understanding, in local mode, ClickHouse, like DataFusion, is a stateless query engine with only Linux page cache available. So I'm very surprised by these results. I will conduct more experiments to try to find out the reason.
@alamb I would really appreciate any advice you could give when you have a moment.
I think we would have to get some detailed profiling to really know for sure, but I suspect that ClickBench has non trivial caches (buffer caching, page caches, etc)
DataFusion, as a serverless engine, does not have any such caching (the only difference between cold/hot run is that on the hot run, data from disk will be in the Linux page cache (so may not do any actual IO)
It might also help to break down which queries showed the biggest discrepancy -- were they queries that already ran in 100ms (in which case caching , avoiding re-reading metadata might be a bigger part of processing)
After conducting more experiments, I made some unexpected discoveries:
In the public clickbench results, Clickhouse was using a version newer than 24.11, while our server had 24.1/24.3 installed. Therefore, I re-ran the benchmark using the latest version 24.12, and this time, the results were similar to those on the clickbench website - Datafusion was faster than Clickhouse in both cold run and hot run phases, and these results were consistently reproducible. This means that recent updates to Clickhouse have led to a decline in its query performance for parquet files. In the earlier versions, Clickhouse still had better performance during the hot run phase.
@alamb I would really appreciate any advice you could give when you have a moment.
I think we would have to get some detailed profiling to really know for sure, but I suspect that ClickBench has non trivial caches (buffer caching, page caches, etc)
DataFusion, as a serverless engine, does not have any such caching (the only difference between cold/hot run is that on the hot run, data from disk will be in the Linux page cache (so may not do any actual IO)
It might also help to break down which queries showed the biggest discrepancy -- were they queries that already ran in 100ms (in which case caching , avoiding re-reading metadata might be a bigger part of processing)
After conducting more experiments, I made some unexpected discoveries:
In the public clickbench results, Clickhouse was using a version newer than 24.11, while our server had 24.1/24.3 installed. Therefore, I re-ran the benchmark using the latest version 24.12, and this time, the results were similar to those on the clickbench website - Datafusion was faster than Clickhouse in both cold run and hot run phases, and these results were consistently reproducible. This means that recent updates to Clickhouse have led to a decline in its query performance for parquet files. In the earlier versions, Clickhouse still had better performance during the hot run phase.
Activity
[-]Update ClickBench benchmarks with DataFusion `43`[/-][+]Update ClickBench benchmarks with DataFusion `43.0.0[/+][-]Update ClickBench benchmarks with DataFusion `43.0.0[/-][+]Update ClickBench benchmarks with DataFusion `43.0.0`[/+]pmcgleenon commentedon Nov 12, 2024
Hi @alamb are we good to proceed with this now that 43.0 has been released (#13254)?
alamb commentedon Nov 13, 2024
Hi @pmcgleenon
I just double checked and this should be good to go now -- the clickbench runner uses
datafusion-clirather than the python bindings (which haven't yet released a version 43.0.0)Thank you so much
pmcgleenon commentedon Nov 13, 2024
take
pmcgleenon commentedon Nov 15, 2024
Hi @alamb here are the initial results.
I've created a composite html file with results for DataFusion releases 33, 34, 36, 40 and 43 so we can compare across the previous releases.
clickbench.html.zip
Single results
Partitioned results
Before running the tests I've updated the SQL to include
OPTIONS ('binary_as_string' 'true')ClickHouse/ClickBench@30fa096
It looks like we've seen some significant gains across a number of queries. Are these results in line with your expectations?
If so I can update the Clickbench to update it with the latest results.
alamb commentedon Nov 15, 2024
Yes, indeed, @korowa @Rachelint @jayzhan211 @XiangpengHao and many others have been hard at work improving the speed. For an idea of what was done: #12821 (comment)
It is sad that we are not yet the fastest engine but interestingly it looks like many places where we are the farthest from the top are the really fast queries (that take 100s of ms)
Thank you again @pmcgleenon
Dandandan commentedon Nov 15, 2024
Looks like we're the fastest for Parquet on

c6a.4xlarge? The difference is 16 cores vs 192 cores (and not shared/virtualized).alamb commentedon Nov 15, 2024
YES! you are totally right @Dandandan
With some more finagling, I filtered for only
c6a.metal 500gb gp2:WOOHOO -- once this gets published it will be time to write a blog post !
Rachelint commentedon Nov 15, 2024
After profiling, I believe we still can get obvious improvement after finishing #11943 and its related epic!
pmcgleenon commentedon Nov 15, 2024
That's an interesting observation. Maybe we can look at benchmarking on
c6a.metalat some point - it might highlight some more areas which could be improved and would show how DataFusion scales out to 192 vCPUspmcgleenon commentedon Nov 15, 2024
I've created a PR on ClickBench to update the results ClickHouse/ClickBench#251
Congratulations everyone on another amazing project milestone!
alamb commentedon Nov 15, 2024
Indeed. I also wanted to point out that item did not make it into 43.0.0 (it was merged shortly after we made the release candidate) so I expect the 44.0.0 release to be even better
4 remaining items
rluvaton commentedon Nov 22, 2024
How is it compared to polars in performance in this benchmark?
alamb commentedon Nov 22, 2024
I don't think Polars can run SQL so it can't run this benchmark
Dandandan commentedon Nov 22, 2024
Polars is included in the benchmark (via in memory DataFrame API) and runs on the biggest machine.
It seems DataFusion is faster on quite some queries even though it reads parquet from disk and runs on a smaller machine.
Dandandan commentedon Nov 22, 2024
See results
alamb commentedon Nov 22, 2024
This is quite interesting. It seems like Polars may also compute min/max/count/sum during load as some queries take 0 time (but there is 275s of load time).
Still 🎣 this would be an excellent optimization for anyone else working on
rluvaton commentedon Nov 23, 2024
The polars test is in python so I don't think that is a fair comparison
Dandandan commentedon Nov 23, 2024
I don't think that's very relevant, as the execution is done natively (Polars is written in Rust). Likewise, DataFusion also would perform about the same in Python.
Running on the biggest machine / and / or reading everything in memory actually gives Polars an advantage, so I think it’s even more impressive to see the difference here.
I think it mainly shows the different optimizations done last ~2 years to make (tricky/expensive) aggregations fast. It may also show some problems in Polars, e.g. with compiling regexes.
waruto210 commentedon Dec 3, 2024
I'm very pleased to see DataFusion achieving such results. However, I encountered some anomalies while trying to reproduce the benchmark, so I'd like to ask for some guidance.
Following the scripts in the ClickBench repository, I ran ClickBench on partitioned parquet files.
During the cold run phase, DataFusion was about 20% faster than ClickHouse, but in the hot run phase, DataFusion was about 20% slower than ClickHouse.
We used a machine with specifications similar to c6a.4xlarge, featuring 16 vCPUs, 32GB of memory, and an SSD with 2GB/s bandwidth. Additionally, we ran ClickBench on a machine with similar specifications but using HDD, and the results were consistent - DataFusion was slower than ClickHouse in the hot run phase.
This was quite unexpected, and I'd like to know if there might be some configuration/compilation parameters that could be causing this issue.
@alamb I would really appreciate any advice you could give when you have a moment.
alamb commentedon Dec 3, 2024
I think we would have to get some detailed profiling to really know for sure, but I suspect that ClickBench has non trivial caches (buffer caching, page caches, etc)
DataFusion, as a serverless engine, does not have any such caching (the only difference between cold/hot run is that on the hot run, data from disk will be in the Linux page cache (so may not do any actual IO)
It might also help to break down which queries showed the biggest discrepancy -- were they queries that already ran in 100ms (in which case caching , avoiding re-reading metadata might be a bigger part of processing)
waruto210 commentedon Dec 3, 2024
For parquet files, ClickHouse uses local mode. In my understanding, in local mode, ClickHouse, like DataFusion, is a stateless query engine with only Linux page cache available. So I'm very surprised by these results. I will conduct more experiments to try to find out the reason.
waruto210 commentedon Dec 4, 2024
After conducting more experiments, I made some unexpected discoveries:
In the public clickbench results, Clickhouse was using a version newer than 24.11, while our server had 24.1/24.3 installed. Therefore, I re-ran the benchmark using the latest version 24.12, and this time, the results were similar to those on the clickbench website - Datafusion was faster than Clickhouse in both cold run and hot run phases, and these results were consistently reproducible. This means that recent updates to Clickhouse have led to a decline in its query performance for parquet files. In the earlier versions, Clickhouse still had better performance during the hot run phase.
@alamb FYI
alamb commentedon Dec 6, 2024
Thank you for the update @waruto210
jayzhan211 commentedon Dec 8, 2024
Do you know which queries are we still lag behind in the old version of clickhouse?
waruto210 commentedon Dec 9, 2024
On our test machines, roughly the following queries are slower:
alamb commentedon Jan 2, 2025
Filed a ticket to run benchmarks with 44:
44.0.0#13983