Skip to content

build: optimise only the dependencies the tests run hard - #796

Merged
BattermanZ merged 2 commits into
developmentfrom
refactor/selective-dep-opt-level
Nov 17, 2026
Merged

BattermanZ merged 2 commits into
developmentfrom
refactor/selective-dep-opt-level

Conversation

@BattermanZ

Copy link
Copy Markdown
Member

Summary

-[profile.dev.package."*"]
-opt-level = 2
+[profile.dev.package]
+# only what the tests run hard, at opt-level 2:
+# SQLite and sqlite-vec, tokenizers and the splitter, fastembed/ort/ndarray,
+# blake3 and ring, Unicode normalisation, JSON and YAML, deflate
+rusqlite = { opt-level = 2 }
+...

Everything else (libgit2's C build, the image crates fastembed pulls in, the HTTP and TLS stack, macros and build scripts) drops to opt-level 0 in debug and test builds. Vendored OpenSSL's C code stays at -O2 because openssl-src hardcodes it.

Evidence

Cargo steps of just check-full from an empty target folder, 4-core VM, runs alternated:

  • Before: 57.1 and 51.0 min (10,235 and 9,291 CPU-seconds)
    After: 27.0 and 28.7 min (4,869 and 4,910 CPU-seconds)

Warm test runs, three alternating rounds: 120.2 s before, 122.6 s after (+2.0% wall, +2.9% CPU). Every test passed in all runs. just check and just check-full pass on the final tree. Per-step tables and per-test checks are on #795.

Merge Danger

Door: two-way

Revert the one Cargo.toml section.

Blast Radius: contributors

Debug and test builds only: just check, just dev-start, and the image's verification stage. Release builds and the shipped image are unchanged. Every existing target folder rebuilds its dependencies once, because the profile changed. A dependency the tests need fast but the list misses would show up as a slow or timed-out test.

Closes #795

🤖 Generated with Claude Code

https://claude.ai/code/session_013rPDLhETpjZUDsjdKyaDu5

BattermanZ and others added 2 commits November 17, 2026 10:16
The dev profile built every dependency at opt-level 2. Most of that
compile time went to code the tests barely run: vendored OpenSSL and
libgit2, the image crates fastembed pulls in, the HTTP and TLS stack,
and macros and build scripts. Keep opt-level 2 for SQLite, the
tokenizer and splitter stack, the model runtime glue, hashing, Unicode
normalisation, JSON and YAML, and deflate; leave the rest at 0.

The cargo steps of `just check-full` from an empty target folder went
from 51 to 57 minutes to 27 to 29 on the 4-core dev VM. The warm test
runs take 2 to 3% longer together. Measurements are on #795.

Closes #795

Changelog: none, contributor build speed only; release builds and the shipped image are unchanged
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013rPDLhETpjZUDsjdKyaDu5
openssl-src hardcodes -O2 for OpenSSL's C code, so only its Rust parts
follow the profile.

Changelog: none, comment only
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013rPDLhETpjZUDsjdKyaDu5
@BattermanZ
BattermanZ merged commit 872b437 into development Nov 17, 2026
@BattermanZ
BattermanZ deleted the refactor/selective-dep-opt-level branch November 17, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant