spark-datafusion-comet-benchmark
Apache Spark with Apache DataFusion Comet Benchmarks
Apache Spark powers large-scale analytics, but its JVM-based execution faces performance limitations. Apache DataFusion Comet attempts to address this by offloading compute operations to a native Rust execution engine built on Apache Arrow DataFusion.
This benchmark evaluates Comet's performance on Amazon EKS using the TPC-DS 3TB workload.
Latest (Iceberg): Apache DataFusion Comet v1.2.0 on Spark 4.1.3 and Iceberg 1.11.0 finished TPC-DS 3TB in 2,195 seconds. That is 18% less runtime than Comet v1.0.0 on Spark 3.5.8, a 1.22× speedup.
- 101 of 103 queries were faster. The best query was 95% faster.
- The only real regression, q17, is equally slow on Spark 4.1.3 without Comet.
Our previous TPC-DS 3TB benchmark, comparing Apache DataFusion Comet v1.0.0 with native Spark 3.5.8, delivered:
- 36% less runtime on Parquet, with a 1.57× speedup. The best query was 69% faster. The largest regression was 36%.
- 43% less runtime on Iceberg, with a 1.75× speedup. The best query was 68% faster. The largest regression was 142%.
Parquet has not been re-run with Comet v1.2.0 yet.
TPC-DS 3TB Benchmark Results
Summary
The TPC-DS 3TB benchmark ran on Amazon EKS. Apache DataFusion Comet v1.0.0 reduced total runtime compared with native Spark for both Parquet and Iceberg tables. Comet v1.2.0 reduced Iceberg runtime by a further 18% compared with Comet v1.0.0. Query results varied by plan, operator, and input shape.
- Parquet
- Iceberg
| Name | Completion Time (seconds) | Speedup |
|---|---|---|
| Native Spark | 3,650.56 | Baseline |
| Comet v1.0.0 | 2,318.74 | 1.57× (36% less runtime) |
| Name | Completion Time (seconds) | Speedup |
|---|---|---|
| Native Spark 3.5.8 | 4,665.47 | Baseline |
| Comet v1.0.0 (Spark 3.5.8) | 2,668.29 | 1.75× (43% less runtime) |
| Comet v1.2.0 (Spark 4.1.3) | 2,195.29 | 1.22× vs Comet v1.0.0 (18% less runtime) |
Comet v1.2.0 ran on a newer software stack (Spark 4.1.3, Iceberg 1.11.0, EKS 1.37), so its gain over v1.0.0 includes the Spark and Iceberg upgrades. A native Spark 4.1.3 baseline has not been published yet. See Test Environment and Configuration.
Benchmark Infrastructure
Benchmarks ran sequentially on the same cluster to ensure identical hardware and eliminate resource contention. Native Spark executed first, followed by Comet.
To ensure an apples-to-apples comparison, both native Spark and Comet jobs ran on identical hardware, storage, and data. Only the execution engine and related Spark settings differed.
Test Environment and Configuration
The Native Spark and Comet v1.0.0 runs shared one environment. The Comet v1.2.0 Iceberg run used the same hardware, executor sizing, and queries on a newer software stack.
| Component | Native Spark | Comet v1.0.0 | Comet v1.2.0 (Iceberg) |
|---|---|---|---|
| EKS Cluster | Amazon EKS 1.34 | Amazon EKS 1.34 | Amazon EKS 1.37 |
| Node Instance Type | r8gd.12xlarge (48 vCPUs, 384GB RAM, 3 × 950GB NVMe SSD) | Same | Same |
| Nodes | 4 dedicated benchmark nodes | Same | 4 on-demand nodes in one AZ, dedicated tainted Karpenter static NodePool |
| Executor Configuration | 23 executors × 5 cores (requests) × 58GB RAM each | Same | Same |
| Driver Configuration | 5 cores × 20GB RAM | Same | Same |
| Shuffle Storage | Local NVMe SSD | Local NVMe SSD | Local NVMe SSD (RAID0) |
| Dataset | TPC-DS 3TB, Parquet and Iceberg | Same | TPC-DS 3TB, Iceberg only (second copy with identical row and file counts) |
| Storage | Amazon S3: S3A for Parquet, Iceberg S3FileIO with Glue catalog | Same | Amazon S3: Iceberg S3FileIO with Glue catalog |
| Iterations | 5 (median per query) | 5 (median per query) | 5 (median per query) |
| Spark Version | 3.5.8 (Scala 2.12) | 3.5.8 (Scala 2.12) | 4.1.3 (Scala 2.13) |
| Comet Version | N/A | 1.0.0 | 1.2.0 |
| Iceberg Version | 1.10.1 | 1.10.1 | 1.11.0 (iceberg-spark-runtime-4.0_2.13) |
| Java Runtime | OpenJDK 17 | OpenJDK 17 | OpenJDK 17.0.19 |
| Execution Engine | JVM-based Tungsten | Rust + JVM hybrid | Rust + JVM hybrid |
| Key Plugins | Standard Spark | CometPlugin, CometShuffleManager | CometPlugin, CometShuffleManager |
| Iceberg Scan | Iceberg Java reader | Comet native Iceberg reader | Comet native Iceberg reader (CometIcebergNativeScan) |
| Off-heap Memory | 32GB enabled | 32GB enabled | 32GB enabled |
| Memory Management | JVM GC | Unified native + JVM | Unified native + JVM |
| memoryThrottlingFactor | 0.7 | 0.7 | 0.7 |
Critical Comet-Specific Configurations
Comet v1.2.0 (Iceberg run):
# Essential Comet Configuration
"spark.plugins": "org.apache.spark.CometPlugin"
"spark.shuffle.manager": "org.apache.spark.sql.comet.execution.shuffle.CometShuffleManager"
"spark.sql.extensions": "org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions,org.apache.comet.CometSparkSessionExtensions"
# Memory Configuration
"spark.memory.offHeap.enabled": "true"
"spark.memory.offHeap.size": "32g"
"spark.comet.exec.memoryPool.fraction": "0.8"
# Comet Execution Settings
"spark.comet.exec.enabled": "true"
"spark.comet.shuffle.enabled": "true"
"spark.comet.explain.fallback.enabled": "true"
# Native Iceberg scan (iceberg-rust) is on by default: spark.comet.scan.icebergNative.enabled=true
# Iceberg catalog
"spark.sql.catalog.glue_catalog": "org.apache.iceberg.spark.SparkCatalog"
"spark.sql.catalog.glue_catalog.catalog-impl": "org.apache.iceberg.aws.glue.GlueCatalog"
"spark.sql.catalog.glue_catalog.io-impl": "org.apache.iceberg.aws.s3.S3FileIO"
spark.comet.exec.shuffle.enabledis nowspark.comet.shuffle.enabled.spark.comet.explainFallback.enabledis nowspark.comet.explain.fallback.enabled.- The default for
spark.comet.scan.icebergNative.dataFileConcurrencyLimit(Iceberg data files read in parallel per task) changed from 1 in Comet 1.0 to 2 in Comet 1.2 (1.0 docs, 1.2 docs). Both runs used the default. spark.comet.exec.shuffle.mode,spark.comet.cast.allowIncompatible, andspark.comet.dppFallback.enabledare not in the current Comet configuration reference, so they were not set for v1.2.0.- Keep the native Iceberg scan enabled. Setting
spark.comet.scan.icebergNative.enabled=falsemakes Iceberg reads use the Java reader, and most operators above the scan then run in Spark's JVM instead of Comet. We tried this to enable the S3 Analytics Accelerator, which only works with the Java reader: total runtime was 1.53× longer (3,355 s vs 2,195 s), and only 42% of plan operators ran in Comet.
Comet v1.0.0:
# Essential Comet Configuration
"spark.plugins": "org.apache.spark.CometPlugin"
"spark.shuffle.manager": "org.apache.spark.sql.comet.execution.shuffle.CometShuffleManager"
# Memory Configuration - Critical for Comet
"spark.memory.offHeap.enabled": "true"
"spark.memory.offHeap.size": "32g" # Required: 16GB minimum, 32GB recommended
# Comet Execution Settings
"spark.comet.exec.enabled": "true"
"spark.comet.exec.shuffle.enabled": "true"
"spark.comet.exec.shuffle.mode": "auto"
"spark.comet.explainFallback.enabled": "true"
"spark.comet.cast.allowIncompatible": "true"
"spark.comet.dppFallback.enabled": "true"
# AWS-Specific: Required for S3 region detection
"spark.hadoop.fs.s3a.endpoint.region": "us-west-2"
Performance Results
- Parquet
- Iceberg
Overall Performance
| Name | Completion Time (seconds) | Performance |
|---|---|---|
| Native Spark | 3,650.56 | Baseline |
| DataFusion Comet 1.0.0 | 2,318.74 | 1.57× (36% less runtime) |
Performance Distribution
| Performance Range | Query Count | Percentage |
|---|---|---|
| 20%+ improvement | 71 | 69% |
| 10-20% improvement | 19 | 18% |
| ±10% | 9 | 9% |
| 10-20% degradation | 2 | 2% |
| 20%+ degradation | 2 | 2% |
Top 10 Query Improvements
| Query | Native Spark (s) | DataFusion Comet 1.0.0 (s) | Speedup |
|---|---|---|---|
| q56-v4.0 | 5.8 | 1.8 | 3.21× (+69%) |
| q58-v4.0 | 5.4 | 1.7 | 3.12× (+68%) |
| q67-v4.0 | 141.2 | 47.0 | 3.01× (+67%) |
| q65-v4.0 | 43.6 | 16.4 | 2.66× (+62%) |
| q97-v4.0 | 43.3 | 16.4 | 2.64× (+62%) |
| q18-v4.0 | 22.0 | 8.8 | 2.50× (+60%) |
| q87-v4.0 | 27.7 | 11.2 | 2.47× (+60%) |
| q38-v4.0 | 27.6 | 11.2 | 2.45× (+59%) |
| q6-v4.0 | 9.3 | 3.9 | 2.38× (+58%) |
| q35-v4.0 | 20.0 | 8.7 | 2.31× (+57%) |
Query Regressions
| Query | Native Spark (s) | DataFusion Comet 1.0.0 (s) | Degradation |
|---|---|---|---|
| q55-v4.0 | 1.4 | 1.8 | 36% slower (0.73×) |
| q50-v4.0 | 82.7 | 104.1 | 26% slower (0.79×) |
| q85-v4.0 | 10.8 | 12.6 | 17% slower (0.86×) |
| q72-v4.0 | 40.4 | 45.0 | 11% slower (0.90×) |
| q84-v4.0 | 10.0 | 10.6 | 5% slower (0.95×) |
| q49-v4.0 | 20.2 | 20.5 | 2% slower (0.98×) |
| q91-v4.0 | 2.1 | 2.1 | 1% slower (0.99×) |
| q52-v4.0 | 1.5 | 1.6 | 1% slower (0.99×) |
| q90-v4.0 | 9.2 | 9.2 | 0% slower (1.00×) |
Performance Analysis
The query results show three main effects: plan changes, native operator performance, and task-tail latency.
| Query | Result | Main cause | Key evidence |
|---|---|---|---|
| q56 | 3.21× faster | Broadcast substitution | Comet removed 3 sort-merge joins and 6 sorts. Shuffle read decreased from 2.2 GB to 38.4 MB. |
| q58 | 3.12× faster | Broadcast substitution | Comet removed 3 sort-merge joins and 6 sorts. Shuffle read decreased by 93%. |
| q67 | 3.01× faster | Native columnar operators | The two main stages were 2.90× and 4.49× faster. GC time decreased from 97.5 seconds to 1.0 second. |
| q55 | 36% slower | Short-query overhead | Stage CPU time increased from 16.2 seconds to 51.0 seconds. One slow task controlled the result. |
| q50 | 26% slower | Native sort and merge CPU | The final stage increased from 45.7 seconds to 81.5 seconds. |
| q85 | 17% slower | Scan tail latency | One scan task increased the critical stage by 3.5 seconds. |
DataFusion Comet v0.17.0 Results
Overall Performance
| Name | Completion Time (seconds) | Performance |
|---|---|---|
| Default | 3,650.56 | Baseline |
| DataFusion Comet 0.17.0 | 2,416.71 | 1.51× (+34% time) |
Performance Distribution
| Performance Range | Query Count | Percentage |
|---|---|---|
| 20%+ improvement | 81 | 79% |
| 10-20% improvement | 16 | 16% |
| ±10% | 5 | 5% |
| 10-20% degradation | 0 | 0% |
| 20%+ degradation | 1 | 1% |
Top 10 Query Improvements
| Query | Default (s) | DataFusion Comet 0.17.0 (s) | Speedup |
|---|---|---|---|
| q56-v4.0 | 5.8 | 1.5 | 3.75× (+73%) |
| q58-v4.0 | 5.4 | 1.8 | 2.99× (+67%) |
| q67-v4.0 | 141.2 | 50.5 | 2.80× (+64%) |
| q97-v4.0 | 43.3 | 17.1 | 2.54× (+61%) |
| q65-v4.0 | 43.6 | 17.7 | 2.47× (+59%) |
| q38-v4.0 | 27.6 | 12.0 | 2.30× (+57%) |
| q83-v4.0 | 2.8 | 1.2 | 2.29× (+56%) |
| q87-v4.0 | 27.7 | 12.2 | 2.27× (+56%) |
| q18-v4.0 | 22.0 | 9.8 | 2.25× (+56%) |
| q81-v4.0 | 18.0 | 8.2 | 2.19× (+54%) |
Query Regressions
Out of 103 TPC-DS query variants, q50 was the single regression under DataFusion Comet 0.17.0 — running 37% slower (82.7s → 113.2s, 0.73×). Every other query matched or outperformed native Spark.
| Query | Default (s) | DataFusion Comet 0.17.0 (s) | Degradation |
|---|---|---|---|
| q50-v4.0 | 82.7 | 113.2 | 37% slower (0.73×) |
Notes on Performance Differences
Two systemic wins drive most of Comet's speedup at the app level: off-heap columnar execution nearly eliminates JVM garbage collection (app-wide GC time −95%, 10,053 s → 538 s) and native columnar shuffle slashes shuffle-read volume (−78%, 12.4 TB → 2.8 TB). Aggregate executor task-time dropped 33%, with disk spill at zero in both runs.
Comet Outperforms Most Queries:
Example - Query 56 (+73%)
- Plan went fully native: all 7 Parquet scans became
CometNativeScan, and the broadcast exchanges, broadcast hash joins, hash aggregates, and sorts all converted to their Comet equivalents — all 7ColumnarToRowbridges were removed (105 → 74 plan nodes). - Shuffle read collapsed 2,345 MB → 40 MB (−98%) and GC fell 1,921 ms → 0 ms, cutting stage-time from 16.8 s to 5.8 s.
- Root cause: A small aggregation/broadcast-join query offloaded end-to-end to Comet, where columnar shuffle removes ~98% of shuffle bytes and the JVM row-conversion/GC overhead disappears.
Example - Query 58 (+67%)
- Same full-native conversion pattern as q56 — scans, filters, broadcast joins, and hash aggregates all become Comet operators, with 7
ColumnarToRowbridges removed. - Shuffle read dropped 395 MB → 28 MB (−93%) and GC 714 ms → 12 ms, cutting stage-time from 11.7 s to 4.3 s.
- Root cause: Identical mechanism to q56 — a broadcast-join + aggregation query fully accelerated by native columnar execution and near-zero-overhead shuffle.
Example - Query 67 (+64%)
- A large rollup/window query (
Expand+Sort+ windowed ranking) that Comet runs natively asCometExpand+CometSort+CometSortMergeJoin. - GC dropped 97,470 ms → 2,030 ms (−98%) — vanilla Spark spent ~97 s of its 140 s in garbage collection; shuffle read also fell 59.5 GB → 31.2 GB (−48%).
- Root cause: A memory-/GC-bound query. Moving the large intermediate data off-heap into Comet's columnar engine almost eliminates the GC pauses that dominated the vanilla-Spark run.
Comet Underperforms on One Query:
Example - Query 50 (-37%)
- Comet still won on the systemic metrics — GC 38,079 ms → 72 ms and its scan stages were faster (36.6 s → 23.6 s) — but the loss is isolated to a single stage: the large
store_sales ⋈ store_returnssort-merge-join + sort reducer. - That stage ran ~2× slower under Comet (
CometSortMergeJoin+CometSort, 90.0 s) than Spark's whole-stage-codegen SMJ + Sort (45.9 s). The +44 s from the slower native join/sort outweighs the −13 s saved on scans, netting +31 s. - Root cause: Comet's native sort-merge-join + sort path is currently ~2× slower than Spark's JIT-compiled codegen for this large fact-to-fact join, and that single stage dominates q50 — so its IO/GC savings cannot compensate.
DataFusion Comet v0.16.0 Results
Overall Performance
| Name | Completion Time (seconds) | Performance |
|---|---|---|
| Default | 3,650.56 | Baseline |
| DataFusion Comet 0.16.0 | 2,467.49 | 1.48× (+32% time) |
Performance Distribution
| Performance Range | Query Count | Percentage |
|---|---|---|
| 20%+ improvement | 68 | 66% |
| 10-20% improvement | 22 | 21% |
| ±10% | 10 | 10% |
| 10-20% degradation | 0 | 0% |
| 20%+ degradation | 3 | 3% |
Top 10 Query Improvements
| Query | Default (s) | DataFusion Comet 0.16.0 (s) | Speedup |
|---|---|---|---|
| q86-v4.0 | 12.8 | 3.7 | 3.47× (+71%) |
| q58-v4.0 | 5.4 | 1.8 | 2.98× (+66%) |
| q56-v4.0 | 5.8 | 2.0 | 2.96× (+66%) |
| q67-v4.0 | 141.2 | 50.7 | 2.79× (+64%) |
| q65-v4.0 | 43.6 | 17.3 | 2.52× (+60%) |
| q97-v4.0 | 43.3 | 17.4 | 2.49× (+60%) |
| q83-v4.0 | 2.8 | 1.2 | 2.37× (+58%) |
| q87-v4.0 | 27.7 | 12.5 | 2.21× (+55%) |
| q38-v4.0 | 27.6 | 12.5 | 2.20× (+55%) |
| q18-v4.0 | 22.0 | 10.1 | 2.18× (+54%) |
Top 3 Query Regressions
Only three queries showed regressions.
| Query | Default (s) | DataFusion Comet 0.16.0 (s) | Degradation |
|---|---|---|---|
| q39a-v4.0 | 5.1 | 7.2 | 42% slower (0.70×) |
| q39b-v4.0 | 4.7 | 6.7 | 41% slower (0.71×) |
| q50-v4.0 | 82.7 | 107.5 | 30% slower (0.77×) |
Notes on Performance Differences
Comet Underperforms on Some Queries:
Example - Query 39a (-42%)
- Plan is fully "Cometized" (no fallback, no row↔columnar transitions inside the pipeline). Wall regression is concentrated in two parallel "scan inventory + 3× BHJ + partial-agg" stages where DPP leaves a single ~20 MB matching Parquet file processed by one straggler task while every other task reads ~0 B.
- DPP collapses inventory to a single 20 MB partition that becomes a stage straggler; native scan + native partial-agg are slower than default's whole-stage-codegen on that single skewed task, and the larger straggler propagates a +1.82s delta into a +2.32s end-to-end regression.
Example - Query 39b (-41%)
- Plan is fully "Cometized"; the regression lives in two parallel
inventorypartial-aggregation stages (Comet 1444/1445 vs default 4051/4052) which contribute +1.541s of the +1.873s wall-clock delta. Heavy tasks process the same ~21 MB / 63 MB shuffle but Comet spends ~1.5s more wall and ~1.6s more CPU each. - Native
CometNativeScan → CometProject → CometBroadcastHashJoin × 3 → CometHashAggregate(stddev_samp+avg, 4-key group-by) → CometExchangepipeline burns more CPU per heavy task than Spark's whole-stage-codegen equivalent on this small ~180 MB dataset.
Comet Outperforms Most Queries:
Example - Query 86 (+71%)
- Default's dominant stage 5152 (Sort + SortMergeJoin + Expand + HashAggregate) ran 8.512s with 4.4 GB shuffle read, 320.3 MB peak on-heap memory, and 1.417s GC — Comet's equivalent stage 10295 finished in 914ms with stage shuffle read = 0 B and 0ms GC because AQE rewired the second join as a CometBroadcastHashJoin over a 6.1 MiB broadcast.
- AQE-driven SortMergeJoin → CometBroadcastHashJoin flip on the item side, enabled by Comet's denser columnar shuffle; eliminates the 4.4 GB SMJ shuffle read and the 320 MB on-heap aggregation buffer.
Example - Query 58 (+66%)
- All 3 SortMergeJoins (and 6 surrounding Sort nodes) in default's executed plan are absent in Comet's: the same 9 logical joins resolve as 8 CometBroadcastHashJoin + 1 BroadcastHashJoin after AQE.
- AQE chose broadcast joins everywhere under Comet, eliminating the 3 SMJ + 6 Sort pipeline; native CometExchange produced 29% smaller shuffle bytes on identical record counts.
DataFusion Comet v0.15.0 Results
Overall Performance
| Name | Completion Time (seconds) | Speedup |
|---|---|---|
| Native Spark | 3,650.56 | Baseline |
| Comet | 3,246.87 | 11% faster |
Performance Distribution
| Performance Range | Query Count | Percentage |
|---|---|---|
| 20%+ improvement | 32 | 31% |
| 10-20% improvement | 19 | 18% |
| ±10% | 44 | 43% |
| 10-20% degradation | 4 | 4% |
| 20%+ degradation | 4 | 4% |
Top 10 Query Improvements
| Query | Native Spark (s) | Comet (s) | Improvement |
|---|---|---|---|
| q5-v4.0 | 40.8 | 20.0 | 51% faster |
| q56-v4.0 | 5.8 | 3.0 | 49% faster |
| q41-v4.0 | 0.8 | 0.4 | 47% faster |
| q45-v4.0 | 12.3 | 7.0 | 43% faster |
| q9-v4.0 | 83.8 | 49.0 | 42% faster |
| q80-v4.0 | 32.6 | 20.1 | 38% faster |
| q58-v4.0 | 5.4 | 3.3 | 38% faster |
| q86-v4.0 | 12.8 | 8.1 | 36% faster |
| q83-v4.0 | 2.8 | 1.8 | 36% faster |
| q73-v4.0 | 3.4 | 2.2 | 36% faster |
Top 10 Query Regressions
| Query | Native Spark (s) | Comet (s) | Degradation |
|---|---|---|---|
| q32-v4.0 | 2.9 | 5.6 | 90% slower |
| q50-v4.0 | 82.7 | 111.5 | 35% slower |
| q39a-v4.0 | 5.1 | 6.3 | 23% slower |
| q68-v4.0 | 5.9 | 7.1 | 21% slower |
| q20-v4.0 | 5.1 | 5.8 | 14% slower |
| q30-v4.0 | 15.9 | 17.7 | 11% slower |
| q67-v4.0 | 141.2 | 156.8 | 11% slower |
| q25-v4.0 | 8.9 | 9.9 | 10% slower |
| q29-v4.0 | 34.4 | 37.8 | 10% slower |
| q91-v4.0 | 2.1 | 2.3 | 10% slower |
Notes on Performance Differences
Why Comet Underperforms on Some Queries:
Example - Query 32 (-90.1%)
- The regressing stages run identical Spark WholeStageCodegen in both apps -- no Comet operators are involved in the slow stages
- Comet's best iteration (2,132ms) is faster than Default's best (2,338ms); the median regression is driven by single-task stragglers reaching 7.1s (10.5x p50) in Comet vs 1.8s max in Default
- Measurement artifact from infrastructure-level straggler interference on a single task out of 118 in Comet's non-Comet scan stages, amplified by 6.6x wider iteration variance (range 8,856ms vs 1,351ms)
Example - Query 39a (-23.1%)
- Inventory scan stage median task time 35-77% higher in Comet (234ms vs 173ms) due to columnar shuffle serialization overhead
- CometColumnarExchange retained 200 partitions where Default used 7, inflating broadcast stage from 32ms to 358ms and producing 3.2x more shuffle data (23.3 MB vs 7.2 MB)
- Two compounding factors: slower scan-stage serialization to Comet's columnar format (+330-538ms), and CometColumnarExchange overriding the natural partition count with 200 partitions for a broadcast exchange that only needed 7
Why Comet Outperforms Some Queries:
Comet's native Rust execution engine excels at CPU-intensive operations
Example - Query 5 (+50.9%)
- Shuffle read on the SortMergeJoin stage dropped 92% (27.9 GB to 2.2 GB) due to Comet's native columnar shuffle for web_sales (2.16B rows)
- GC time in the scan stage dropped from 7,236ms to 77ms; CometSort was 56% faster than Spark Sort (13.9 min vs 31.9 min total)
- Comet's native scan-filter-exchange pipeline for web_sales produced compact Arrow columnar shuffle data, massively reducing downstream shuffle read and sort time in the join stage, with cascading contention reduction benefiting non-Comet stages
Example - Query 56 (+49.0%)
- AQE converted all three SortMergeJoins to BroadcastHashJoins because CometExchange reported customer_address shuffle size as 2.7 MiB (vs 10.7 MiB in Default), falling below the 10 MB broadcast threshold
- Combined join stage time dropped from 8.6s to 1.4s; GC dropped from 2.8s to 206ms
- Comet's Arrow columnar shuffle encoding produced a more compact representation that caused AQE to select broadcast joins, eliminating sort buffers, shuffle overhead, and GC pressure from sort buffer allocation
Resource Usage Analysis
These resource metrics were captured during the Comet v0.15.0 Parquet run. Both benchmarks ran sequentially on identical hardware to enable direct comparison.
CPU Utilization
CPU utilization showed similar patterns between Native Spark and Comet, with both sustaining comparable peak and average usage throughout the benchmark.


Memory Utilization
Comet consumed more memory than Native Spark, peaking around ~52GB compared to ~48GB for Native Spark. Native Spark's memory usage returned to a baseline of ~20GB between queries, while Comet remained elevated. This is expected — Comet offloads most compute operations to its native Rust engine using off-heap memory, so the JVM heap sees less activity while native allocations persist between queries. This suggests that on-heap JVM memory per executor could potentially be reduced when running Comet, shifting the memory budget toward off-heap allocation.


Network Bandwidth
Network bandwidth was comparable between Native Spark and Comet, with both showing similar transmit and receive throughput.


Storage I/O
Storage utilization (IOPS and throughput) showed Comet with higher peak IOPS than Native Spark.


Full Grafana Dashboard — Native Spark (Default)

Full Grafana Dashboard — Comet

Summary: Comet uses slightly more memory than Native Spark (higher peak and elevated baseline between queries), while CPU, network, and storage utilization remain comparable. The 11% overall speedup in that run came without a significant increase in resource consumption. Since Comet performs most compute off-heap in its native Rust engine, operators may be able to reduce on-heap JVM memory per executor and allocate more toward off-heap, potentially improving cost efficiency.
DataFusion Comet v1.2.0 vs v1.0.0
Comet v1.2.0 ran on Spark 4.1.3 and Iceberg 1.11.0. The v1.0.0 run used Spark 3.5.8 and Iceberg 1.10.1. Hardware, executor sizing, queries, and iterations were the same. The differences below include the effect of the Spark and Iceberg upgrades, not only the Comet release.
Overall Performance
| Name | Completion Time (seconds) | Performance |
|---|---|---|
| Native Spark 3.5.8 | 4,665.47 | Previous native baseline |
| DataFusion Comet Iceberg 1.0.0 (Spark 3.5.8) | 2,668.29 | Baseline for this comparison |
| DataFusion Comet Iceberg 1.2.0 (Spark 4.1.3) | 2,195.29 | 1.22× (18% less runtime than v1.0.0) |
Per-query, the geometric mean speedup was 1.34× and the median query speedup was 1.28×. Comet v1.2.0 was faster on 101 of 103 queries.
Performance Distribution
| Performance Range | Query Count | Percentage |
|---|---|---|
| 20%+ improvement | 57 | 55% |
| 10-20% improvement | 36 | 35% |
| ±10% | 9 | 9% |
| 10-20% degradation | 0 | 0% |
| 20%+ degradation | 1 | 1% |
Top 10 Query Improvements
| Query | DataFusion Comet Iceberg 1.0.0 (s) | DataFusion Comet Iceberg 1.2.0 (s) | Speedup |
|---|---|---|---|
| q16-v4.0 | 29.4 | 1.5 | 19.3× (+95%) |
| q85-v4.0 | 10.9 | 5.2 | 2.11× (+53%) |
| q49-v4.0 | 16.8 | 8.1 | 2.08× (+52%) |
| q21-v4.0 | 2.0 | 1.0 | 2.07× (+52%) |
| q19-v4.0 | 5.4 | 2.7 | 2.00× (+50%) |
| q40-v4.0 | 9.7 | 5.1 | 1.89× (+47%) |
| q84-v4.0 | 6.0 | 3.2 | 1.85× (+46%) |
| q70-v4.0 | 13.0 | 7.5 | 1.75× (+43%) |
| q20-v4.0 | 3.6 | 2.1 | 1.72× (+42%) |
| q34-v4.0 | 6.0 | 3.5 | 1.71× (+42%) |
Most of the total time saved came from the long-running queries:
| Query | DataFusion Comet Iceberg 1.0.0 (s) | DataFusion Comet Iceberg 1.2.0 (s) | Time Saved (s) | Speedup |
|---|---|---|---|---|
| q23a-v4.0 | 173.3 | 130.2 | 43.1 | 1.33× |
| q23b-v4.0 | 216.3 | 183.5 | 32.8 | 1.18× |
| q16-v4.0 | 29.4 | 1.5 | 27.9 | 19.3× |
| q9-v4.0 | 183.4 | 155.8 | 27.6 | 1.18× |
| q24a-v4.0 | 73.7 | 58.6 | 15.1 | 1.26× |
| q72-v4.0 | 134.1 | 119.3 | 14.8 | 1.12× |
| q75-v4.0 | 47.5 | 32.8 | 14.7 | 1.45× |
| q24b-v4.0 | 71.8 | 57.8 | 14.0 | 1.24× |
| q93-v4.0 | 154.1 | 141.0 | 13.1 | 1.09× |
| q50-v4.0 | 109.4 | 96.8 | 12.6 | 1.13× |
Query Regressions
Out of 103 TPC-DS query variants, q17 was the only meaningful regression. It took 25.1 s with Comet v1.2.0 vs 6.5 s with v1.0.0 (0.26×). Spark 4.1.3 without Comet is equally slow on q17, so this regression comes with the Spark 4.1.3 stack, not Comet. q31 was within 1%.
| Query | DataFusion Comet Iceberg 1.0.0 (s) | DataFusion Comet Iceberg 1.2.0 (s) | Degradation |
|---|---|---|---|
| q17-v4.0 | 6.5 | 25.1 | 284% slower (0.26×) |
| q31-v4.0 | 9.6 | 9.8 | 1% slower (0.99×) |
Performance Analysis
| Query | Result vs v1.0.0 | Main cause | Key evidence |
|---|---|---|---|
| q16 | 19.3× faster | Early empty-result short-circuit | The executed plan ends in CometEmptyRelation: adaptive query execution found an empty intermediate result and skipped the remaining joins. Spark 4.1.3 without Comet also runs q16 faster than Spark 3.5.8 (about 19 s vs 63 s), so part of this gain comes with Spark 4.x. |
| q23a, q23b | 1.33× and 1.18× faster | Faster long-running fact-table joins and aggregations | These two queries saved 76 s combined, the largest share of the 473 s total saving. |
| q17 | 3.8× slower | Spark 4.1.3 stack, not Comet | Spark 4.1.3 without Comet takes about 25 s on q17, the same as Comet v1.2.0, while native Spark 3.5.8 took 12.9 s. |
| q72 | 1.12× faster, but still 2.15× slower than native Spark 3.5.8 | Comet-specific regression remains | Comet v1.2.0 took 119.3 s vs 55.5 s for native Spark 3.5.8. Spark 4.1.3 without Comet takes about 50 s, so this gap is specific to Comet. |
The "Spark 4.1.3 without Comet" figures come from a separate run on the same cluster, with the same image minus Comet and with the S3 Analytics Accelerator enabled. They are used here only to tell Spark-version effects apart from Comet effects. That run is not a published native baseline.
In the v1.2.0 run, Comet executed about 100% of plan operators across all 103 queries (5,564 Comet operators vs 11 Spark operators in steady-state iteration 3). All 5 iterations completed with no failed queries. Out of 103 TPC-DS query variants, q50 was the single regression under DataFusion Comet Iceberg 0.17.0 — running 23% slower (96.3s → 118.3s, 0.81×). Every other query matched or outperformed native Spark. Only three queries showed regressions.DataFusion Comet Iceberg v1.0.0 Results
Overall Performance
Name Completion Time (seconds) Performance Native Spark Iceberg 4,665.47 Baseline DataFusion Comet Iceberg 1.0.0 2,668.29 1.75× (43% less runtime) Performance Distribution
Performance Range Query Count Percentage 20%+ improvement 93 90% 10-20% improvement 5 5% ±10% 3 3% 10-20% degradation 1 1% 20%+ degradation 1 1% Top 10 Query Improvements
Query Native Spark Iceberg (s) DataFusion Comet Iceberg 1.0.0 (s) Speedup q90-v4.0 31.6 10.1 3.13× (+68%) q67-v4.0 147.6 48.6 3.03× (+67%) q56-v4.0 6.7 2.3 2.93× (+66%) q49-v4.0 47.6 16.8 2.84× (+65%) q97-v4.0 46.5 16.7 2.79× (+64%) q38-v4.0 30.5 12.2 2.50× (+60%) q35-v4.0 21.8 8.8 2.49× (+60%) q87-v4.0 30.5 12.3 2.47× (+60%) q6-v4.0 9.6 4.0 2.39× (+58%) q81-v4.0 15.2 6.5 2.34× (+57%) Query Regressions
Query Native Spark Iceberg (s) DataFusion Comet Iceberg 1.0.0 (s) Degradation q72-v4.0 55.5 134.1 142% slower (0.41×) q50-v4.0 96.3 109.4 14% slower (0.88×) q21-v4.0 1.9 2.0 5% slower (0.95×) DataFusion Comet Iceberg v0.17.0 Results
Overall Performance
Name Completion Time (seconds) Performance Default Iceberg 4,665.47 Baseline DataFusion Comet Iceberg 0.17.0 2,803.80 1.66× (+40% time) Performance Distribution
Performance Range Query Count Percentage 20%+ improvement 98 95% 10-20% improvement 3 3% ±10% 1 1% 10-20% degradation 0 0% 20%+ degradation 1 1% Top 10 Query Improvements
Query Default Iceberg (s) DataFusion Comet Iceberg 0.17.0 (s) Speedup q56-v4.0 6.7 1.9 3.56× (+72%) q90-v4.0 31.6 10.1 3.12× (+68%) q67-v4.0 147.6 50.0 2.96× (+66%) q97-v4.0 46.5 17.2 2.69× (+63%) q49-v4.0 47.6 18.6 2.56× (+61%) q38-v4.0 30.5 13.4 2.29× (+56%) q87-v4.0 30.5 13.4 2.27× (+56%) q35-v4.0 21.8 9.9 2.20× (+54%) q48-v4.0 16.3 7.6 2.15× (+53%) q78-v4.0 151.9 70.9 2.14× (+53%) Query Regressions
Query Default Iceberg (s) DataFusion Comet Iceberg 0.17.0 (s) Degradation q50-v4.0 96.3 118.3 23% slower (0.81×) DataFusion Comet Iceberg v0.16.0 Results
Overall Performance
Name Completion Time (seconds) Performance Default Iceberg 4,665.47 Baseline DataFusion Comet Iceberg 0.16.0 2,922.30 1.60× (+37% time) Performance Distribution
Performance Range Query Count Percentage 20%+ improvement 93 90% 10-20% improvement 6 6% ±10% 1 1% 10-20% degradation 0 0% 20%+ degradation 3 3% Top 10 Query Improvements
Query Default Iceberg (s) DataFusion Comet Iceberg 0.16.0 (s) Speedup q86-v4.0 14.9 4.7 3.14× (+68%) q56-v4.0 6.7 2.2 3.09× (+68%) q90-v4.0 31.6 11.6 2.73× (+63%) q67-v4.0 147.6 54.3 2.72× (+63%) q97-v4.0 46.5 18.3 2.53× (+61%) q49-v4.0 47.6 19.1 2.49× (+60%) q38-v4.0 30.5 14.4 2.12× (+53%) q35-v4.0 21.8 10.4 2.09× (+52%) q87-v4.0 30.5 14.6 2.08× (+52%) q78-v4.0 151.9 74.4 2.04× (+51%) Top 3 Query Regressions
Query Default Iceberg (s) DataFusion Comet Iceberg 0.16.0 (s) Degradation q39b-v4.0 4.9 7.4 53% slower (0.65×) q39a-v4.0 5.8 8.0 37% slower (0.73×) q50-v4.0 96.3 117.4 22% slower (0.82×)
When to Consider Comet
Comet may be beneficial for:
- Broadcast-join workloads - Queries such as q56 and q58 gained when Comet removed sort-merge joins and sorts.
- Native columnar workloads - q67 gained from the native sort, merge, and aggregate operators.
- Iceberg workloads with the native scan - Comet v1.2.0 ran about 100% of Iceberg plan operators natively when
spark.comet.scan.icebergNative.enabledstayed at its default (true). - Tested query sets - Test your full query set before deployment.
Running Benchmarks
The steps below reproduce the Comet v1.2.0 Iceberg run. All files are in data-stacks/spark-on-eks/benchmarks/datafusion-comet-benchmarks/.
Prerequisites
- The Spark on EKS data stack deployed, with Spark Operator and Karpenter
- TPC-DS 3TB data as Iceberg tables in an S3 bucket (under
TPCDS-TEST-3TB-ICEBERG/), registered in an AWS Glue database - Read access to the data bucket and write access to a results bucket for the
spark-team-aservice account - A container registry (Amazon ECR or another registry)
Step 1: Build the Docker Image
cd data-stacks/spark-on-eks/benchmarks/datafusion-comet-benchmarks
# Spark 4.1.3 + Iceberg 1.11.0 + Comet 1.2.0, linux/arm64 (Graviton)
docker build --platform linux/arm64 --build-arg INCLUDE_COMET=true \
-t <your-registry>/spark-comet:4.1.3-iceberg-1.11.0-comet-1.2.0 -f Dockerfile-comet .
docker push <your-registry>/spark-comet:4.1.3-iceberg-1.11.0-comet-1.2.0
Build with --build-arg INCLUDE_COMET=false for the native Spark image.
Step 2: Create Dedicated Benchmark Nodes
The benchmark runs on a fixed set of 4 × r8gd.12xlarge nodes from a Karpenter static NodePool (spec.replicas). The nodes carry the taint benchmark=tpcds:NoSchedule, so only the benchmark pods run on them, and Karpenter doesn't consolidate or replace them during a run.
Static NodePools require Karpenter's StaticCapacity feature gate (alpha). Enable it in data-stacks/spark-on-eks/terraform/data-stack.tfvars and redeploy:
enable_karpenter_static_capacity = true
cd data-stacks/spark-on-eks && ./deploy.sh
Set the availability zone in nodepool-tpcds-benchmark.yaml (default us-west-2a), then create the NodePool and wait for the 4 nodes:
cd benchmarks/datafusion-comet-benchmarks
kubectl apply -f nodepool-tpcds-benchmark.yaml
kubectl get nodes -l karpenter.sh/nodepool=tpcds-benchmark -w
Each node fits 6 Spark pods (58GB each), so 4 nodes hold the driver and all 23 executors.
Step 3: Install NodeLocal DNS Cache (Optional)
To reduce DNS query volume to the Route 53 Resolver, install NodeLocal DNS Cache:
kubectl apply -f node-local-cache.yaml
The Comet v1.2.0 run was done without it.
Step 4: Run the Benchmark
Create the Log4j ConfigMap used by the manifests:
kubectl apply -f ../../spark-log4j2-configmap.yaml
Set the variables and submit the Comet Iceberg benchmark. BENCH_ZONE must match the zone in the NodePool.
export RUN_ID=$(date -u +%Y%m%d%H%M)
export DATA_BUCKET=<bucket-with-TPCDS-TEST-3TB-ICEBERG>
export LOGS_BUCKET=<bucket-for-results-and-event-logs>
export ICEBERG_DB=<glue-database-with-tpcds-tables>
export IMAGE_COMET=<your-registry>/spark-comet:4.1.3-iceberg-1.11.0-comet-1.2.0
export ITERATIONS=5 EXECUTOR_INSTANCES=23 QUERY_FILTER="" BENCH_ZONE=us-west-2a
envsubst < tpcds-benchmark-spark41-comet-iceberg.yaml | kubectl apply -f -
tpcds-benchmark-spark41-comet-iceberg-s3-aal.yaml runs Comet with the S3 Analytics Accelerator. It turns off Comet's native Iceberg scan, which made the run about 1.5× slower in our tests.
Run benchmarks one at a time so they don't compete for nodes. The Parquet benchmarks use tpcds-benchmark-comet-parquet.yaml and tpcds-benchmark-parquet.yaml with S3_BUCKET instead.
Step 5: Monitor Benchmark Progress
# Check job status
kubectl get sparkapplications -n spark-team-a -l benchmark=tpcds-3tb-iceberg
# View driver logs
kubectl logs -f -n spark-team-a -l spark-role=driver,benchmark=tpcds-3tb-iceberg
A full run (103 queries × 5 iterations) takes about 3.5 hours with Comet v1.2.0.
Step 6: Analyze Results
Each run writes per-query results to s3://$LOGS_BUCKET/TPCDS-3TB-ICEBERG-RESULTS/. The summary.csv file has one row per query: the median, minimum, and maximum time across iterations. Compare two runs with analyze-results.py:
aws s3 cp --recursive s3://$LOGS_BUCKET/TPCDS-3TB-ICEBERG-RESULTS/test1-comet/$RUN_ID/ ./results/ \
--exclude "*" --include "*summary.csv/*.csv"
cat results/*/summary.csv/*.csv > comet-iceberg-candidate.csv
python3 ../analyze-results.py \
--baseline comet-iceberg-v1.2.0.csv --candidate comet-iceberg-candidate.csv \
--baseline-name "Comet 1.2.0" --candidate-name "My run" \
-o report.json --markdown report.md
Step 7: Clean Up
Release the benchmark nodes when you are done:
kubectl scale nodepool tpcds-benchmark --replicas=0
# or remove the NodePool entirely
kubectl delete -f nodepool-tpcds-benchmark.yaml