Summary
Full-feature builds (--all-features) take significant time due to 98 feature flags and 55 workspace members. This issue tracks investigation and optimization of compile times.
Current state
- 98 feature flags (default = empty set)
- 55 workspace members (main crate + symthaea-core + 53 sub-crates)
- CI runs 18+ feature combination jobs in the matrix
- Key heavy features:
lancedb-backend, neural-bridge, ssm_language, full_consciousness
Investigation areas
- Feature unification — identify features that are almost always used together and merge them
- Conditional compilation boundaries — ensure
#[cfg(feature = "X")] is at module level, not sprinkled through functions
- Parallel compilation bottlenecks — identify crates that serialize the build graph
- Dependency deduplication — check for multiple versions of the same crate pulled by different features
- Build script optimization — audit
build.rs files across sub-crates
- Type complexity — deeply nested generics slow rustc; identify hot spots with
-Z time-passes
How to measure
# Time a full build from clean
cargo clean && time cargo build --all-features
# Identify slow crates
cargo build --all-features --timings
# Check dependency tree
cargo tree --duplicates
Constraints
- Do NOT use custom
CARGO_TARGET_DIR — sccache handles caching
- One session per workspace to avoid cargo lock contention
Summary
Full-feature builds (
--all-features) take significant time due to 98 feature flags and 55 workspace members. This issue tracks investigation and optimization of compile times.Current state
lancedb-backend,neural-bridge,ssm_language,full_consciousnessInvestigation areas
#[cfg(feature = "X")]is at module level, not sprinkled through functionsbuild.rsfiles across sub-crates-Z time-passesHow to measure
Constraints
CARGO_TARGET_DIR— sccache handles caching