Visorgood commented on code in PR #221:
URL: https://github.com/apache/datafusion-site/pull/221#discussion_r4679580069


##########
content/blog/2026-11-22-comet-spark-comparison.md:
##########
@@ -0,0 +1,391 @@
+---
+layout: post
+title: Where Apache Spark loses time, and how Apache DataFusion Comet gets it 
back
+date: 2026-11-22
+author: Viacheslav Inozemtsev
+categories: [performance, subprojects]
+---
+
+<!--
+{% comment %}
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+-->
+
+[TOC]
+
+## Introduction
+
+[Apache DataFusion Comet](https://datafusion.apache.org/comet/) is an 
accelerator for [Apache Spark](https://spark.apache.org/) that can also read 
and write [Apache Iceberg](https://iceberg.apache.org/) tables natively. It is 
built on top of [Apache DataFusion](https://datafusion.apache.org/), a query 
engine written in Rust on [Apache Arrow](https://arrow.apache.org/). Comet 
plugs into Spark without changes to the jobs: it takes the physical plan that 
Spark has built and executes the operators it supports in native code. The 
promise is better performance thanks to two things: Comet processes data in 
columnar Arrow batches instead of one row at a time, and it runs in native code 
outside the JVM, without JVM objects and their overhead. The project's README 
states a speedup of about 1.8 times on TPC-DS at 1 TB, which translates into 
roughly 45% lower cost.
+
+Numbers like these are useful, but they don't explain where the gain comes 
from. The usual answer – "Comet is columnar and native" – is true, but it 
explains less than it seems, because Spark's own Iceberg reader already decodes 
Parquet into Arrow vectors. If both engines start from columnar batches, where 
exactly does Spark lose time, and what does Comet do differently? I wanted to 
see this in detail, step by step, on a real job.
+
+In this post, I will take one ordinary ETL job – read an Iceberg table, filter 
it, compute a value, aggregate it, and write the result into another Iceberg 
table – and run it with plain Spark and with Spark + Comet. We will follow a 
few rows through every step of the job in both engines, look at the CPU 
profiles, and estimate how much CPU each step costs. On 8 cores, plain Spark 
took 38.7 seconds and 295 CPU-seconds, and Spark with Comet took 10.5 seconds 
and 76 CPU-seconds, with the same output. Then we will look at the opposite 
case: how one unsupported expression takes most of this gain away. I will 
finish with a practical guide on checking and tuning Comet for your own jobs.

Review Comment:
   Thanks, added the caveat next to the headline numbers in 50beb31. A run with 
Comet's defaults is a good idea: I'll add it to the harness as a fourth 
configuration and put its numbers into the post in a follow-up commit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to