perf(build): don't build the doc-generator binaries by default - #24338
Merged
Conversation
`datafusion/core/src/bin/` holds three binaries that regenerate the docs under
`docs/source/user-guide`: `print_config_docs`, `print_runtime_config_docs` and
`print_functions_docs`. They are auto-discovered by cargo with no
`required-features`, so every `cargo build` links all three -- each ~174MB,
against a crate whose own rlib they link in full.
They are only ever run by `dev/update_config_docs.sh` and
`dev/update_function_docs.sh` (and by the CI job that checks the committed docs
are up to date), so they now sit behind a non-default `docs_generation` feature,
and those scripts pass `--features docs_generation`.
Effect on the two builds that matter:
- Cold `cargo build -p datafusion`: the three binaries link *after* everything
else has finished, so they sit on the critical path with nothing to overlap
with. `cargo build --timings` shows them occupying the last 3.5s of the build
(~8.8s of CPU).
- Edit-a-file-in-core and rebuild, the tightest inner loop -- they are relinked
every time:
before: 3.0s 2.4s
after: 1.3s 1.1s
Verified that a default `cargo build -p datafusion` no longer produces them,
that `--features docs_generation` does, and that `./dev/update_config_docs.sh`
still regenerates `docs/source/user-guide/configs.md` byte-identically.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 13, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24338 +/- ##
==========================================
+ Coverage 81.14% 81.17% +0.03%
==========================================
Files 1112 1109 -3
Lines 386933 386746 -187
Branches 386933 386746 -187
==========================================
- Hits 313967 313957 -10
+ Misses 54476 54295 -181
- Partials 18490 18494 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
comphead
approved these changes
Aug 13, 2026
comphead
left a comment
Contributor
There was a problem hiding this comment.
Thanks @Dandandan good catch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Adresses: #13814
Found while profiling compile times for #24325 / #24326 / #24329 / #24330.
Rationale for this change
datafusion/core/src/bin/holds three binaries that regenerate the docs underdocs/source/user-guide:print_config_docs,print_runtime_config_docsandprint_functions_docs. Cargo auto-discovers them and they have norequired-features, so everycargo buildlinks all three — each one~174MB, since each links the whole
datafusionrlib.Nothing in normal development uses them. They are run by
dev/update_config_docs.shanddev/update_function_docs.sh, and by the CI jobthat checks the committed docs are up to date.
Two places where this shows up:
Cold builds. The three binaries link after every other unit has finished,
so they sit on the critical path with nothing to overlap with.
cargo build --timingsshows them occupying the last 3.5s of acargo build -p datafusion(~8.8s of CPU), after the last library unitcompletes.
The tightest inner loop — touch a file in core, rebuild. All three are
relinked every time:
What changes are included in this PR?
The three binaries move behind a new non-default
docs_generationfeature, andthe two
dev/scripts pass--features docs_generation.Using
required-featuresmeans declaring the[[bin]]targets explicitly, sinceauto-discovered targets cannot carry it.
Are these changes tested?
cargo build -p datafusionno longer produces the three binariescargo build -p datafusion --features docs_generationdoes./dev/update_config_docs.shstill regeneratesdocs/source/user-guide/configs.mdbyte-identically (emptygit diffafterwards), which is what the CI doc check compares
dev/update_function_docs.shuses the same invocation pattern and all three ofits call sites were updated; CI exercises both scripts.
Are there any user-facing changes?
The three binaries are no longer built by a default
cargo build. Anyone whoran them directly needs
--features docs_generation— same as thedev/scriptsnow do. No library API changes.
If you would rather these lived outside the published crate altogether, moving
them to a small non-published
dev/crate would have the same effect on buildtimes; I went with the smaller change.
🤖 Generated with Claude Code