andygrove commented on issue #4406:
URL:
https://github.com/apache/datafusion-comet/issues/4406#issuecomment-4519767548
## CI workload analysis for one `main` commit
To inform this issue, here is a breakdown of every workflow that ran on a
single representative `push` to `main` (commit
[`354ad46`](https://github.com/apache/datafusion-comet/commit/354ad4630679b77cbd6646ba697a49bbd9459b79),
2026-05-22). It shows where the Action minutes actually go. The full report is
in the collapsed section at the bottom.
### Workflow durations
| Workflow | Duration | Jobs |
|---|--:|--:|
| Spark SQL Tests | **1h 45m** | 30 |
| Run Miri Safety Checks | **1h 28m** | 1 |
| Iceberg Spark SQL Tests | **1h 23m** | 19 |
| PR Build (macOS) | **52m** | 23 |
| PR Build (Linux) | **52m** | 48 |
| CodeQL | 2m 09s | 1 |
| RAT License Check | 40s | 1 |
| Check all test suites added to PR workflows | 17s | 1 |
| Validate Github Workflows | 10s | 1 |
The commit finishes when the slowest workflow does (~1h 45m), gated by
**Spark SQL Tests**. Every test workflow also pays a fixed **20-28m "Build
Native Library"** cost before any test job can start.
### Where the time goes, and where to cut it
1. **Spark SQL Tests gates the whole commit at 1h 45m.** The long pole is
the `sql_core-1` shard on Spark 4.0/4.1 (60-77m each). Re-balancing the
`sql_core` shards, especially splitting the large `SQLQueryTestSuite` golden
files off `sql_core-1`, would cut the critical path most directly.
2. **A handful of tests dominate Comet's own suites.** Across both PR Build
workflows, roughly 10 tests carry the load: `CometJoinSuite > Broadcast hash
join build-side batch coalescing` (156-210s, once per Spark version),
`CometAggregateSuite > all types, with nulls` (101-154s), and
`CometFuzzIcebergSuite > Iceberg temporal types written as
INT96/TIMESTAMP_MICROS/TIMESTAMP_MILLIS` (88-174s).
3. **The native build is a 20-28m fixed tax** paid before every test
workflow. Better Rust build caching (sccache or a shared artifact) would
shorten the start of every test workflow.
4. **Miri is bottlenecked by one crate.** The `spark-expr` test binary alone
is 76 of the job's 88 minutes. Splitting Miri across crates into parallel jobs
would roughly halve it.
5. **The Iceberg matrix carries dead weight.** 6 `iceberg-spark-runtime`
jobs run no test suite at all (~4m each of pure overhead), and the 1.8.1/1.9.1
jobs run the same suites silently for 35-46m. Trimming to one Spark version per
variant plus dropping the test-less runtime jobs would cut roughly half that
workflow's wall time.
6. **The Rust unit tests are not the cost.** All 546 nextest tests execute
in ~6.3s total; the 20m `rust-test` job is almost entirely compilation.
Full report (per-workflow job timings and slowest
tests)
### Methodology
- Per-test durations are exact for **Comet ScalaTest jobs** (PR Build
Linux/macOS), **Spark SQL Tests** (ScalaTest `(duration)` lines), and **Rust
nextest** (`PASS [Xs]`).
- **Iceberg** logs carry no per-test durations; figures are timestamp-delta
proxies distorted by parallel Gradle workers. Trust the class rankings, not the
absolute seconds.
- **Miri** per-test timing is unreliable (interpreted cooperative threading
bursts output at the end), so attribution stops at the binary level.
- Job "wall time" is first-to-last log timestamp and includes
checkout/setup, not just test execution.
The shared up-front native build cost:
| Workflow | Native build job | Duration |
|---|---|--:|
| PR Build (Linux) | Build Native Library | 28m 07s |
| Iceberg Spark SQL Tests | Build Native Library | 28m 11s |
| Spark SQL Tests | Build Native Library | 27m 34s |
| PR Build (macOS) | Build Native Library (macOS) | 20m 20s |
### Spark SQL Tests (1h 45m)
Runs Apache Spark's own SQL test suites (`sql/core`, `sql/catalyst`,
`sql/hive`) with the Comet plugin enabled, sharded across 28 test jobs over
{Spark 3.4.3, 3.5.8, 4.0.2, 4.1.1}. 101,908 per-test lines parsed.
Slowest jobs:
| Job | Wall time |
|---|--:|
| sql_core-1 / spark-4.0.2-jdk21 | 77m |
| sql_hive-1 / spark-4.1.1-jdk17 | 68m |
| sql_core-1 / spark-4.1.1-jdk17 | 63m |
| sql_hive-1 / spark-4.0.2-jdk21 | 61m |
| sql_core-1 / spark-3.5.8-jdk11 | 57m |
| sql_core-2 / spark-4.1.1-jdk17 | 56m |
| sql_core-3 / spark-4.0.2-jdk21 | 53m |
| catalyst jobs | 16-18m (cheapest module) |
Top 15 slowest individual tests:
| Test | Dur | Job |
|---|--:|---|
| subquery/in-subquery/in-joins.sql | 121s | sql_core-2 / 3.5.8 |
| SPARK-40492: maintenance before unload | 120s | sql_core-2 / 3.4.3 |
| SPARK-40492: maintenance before unload | 120s | sql_core-2 / 3.5.8 |
| subquery/in-subquery/in-joins.sql | 118s | sql_core-2 / 4.1.1 |
| SPARK-39381: vectorized orc columnar