Skip to content

build(profile): compile non-kernel workspace crates at dev opt-level 0 - #3087

Merged
ScriptedAlchemy merged 10 commits into
masterfrom
devin/1791144987-dev-opt0-nonkernel
Oct 5, 2026
Merged

ScriptedAlchemy merged 10 commits into
masterfrom
devin/1791144987-dev-opt0-nonkernel

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Compiles every non-kernel tracedecay-* workspace crate at dev opt-level = 0 (40 crates), mirroring the existing tracedecay-contracts / tracedecay-daemon-protocol precedent.
  • Adds [profile.perf.package.*] opt-level = 1 mirrors so perf (which inherits dev overrides) keeps every crate at its previous effective level.
  • Cold cargo build -p tracedecay-cli on 8 cores: 461s → 345s wall (−25%), workspace CPU 2156s → 1178s (−45%). One timed run each.

Motivation

A --timings critical-path audit (walking unblocked_units/unblocked_rmeta_units backward from the last unit) shows the wall clock is a serial chain of workspace crates whose cost is ~85% LLVM codegen at dev opt-level = 1:

schemars proc-macros (16s) → domain 107s → contracts 87s → rusqlite-runtime 103s
→ runtime-core 43s → daemon-identity/control → daemon-service 61s → mcp 45s
→ tracedecay 98s → tracedecay-cli link 18s

Frontend time is small (5-29s per crate); codegen is 33-96s. tracedecay (the root crate) is the slowest gating crate near the tail (98s) because it depends on all 64 workspace crates and can only start once every rmeta is ready; tracedecay-application (158s) is the slowest overall crate but finishes in parallel and does not gate.

Measured: dev opt-level = 0 on the non-kernel crates removes ~116s of wall time. The kernel crates that are perf-pinned (code-index, code-index-runtime, domain, graph-db, runtime-core, rusqlite-runtime, store, code-extraction, grafeo-*) keep dev opt-level = 1, so local cargo test still runs optimized engine code.

For comparison, dropping the kernels to opt-level = 0 too reaches 257s wall (−44%), at the cost of running all engine code unoptimized in local dev/test builds, left out of this PR.

Changes

  • Cargo.toml: [profile.dev.package.*] opt-level = 0 for 40 non-kernel workspace crates plus [profile.perf.package.*] opt-level = 1 mirrors.

Test plan

  • cargo build -p tracedecay-cli passes and produces a working binary (timed run above)
  • cargo nextest run --workspace --no-fail-fast passes (CI)
  • cargo clippy has no new warnings (no code changes)

Checklist

  • CHANGELOG.md updated, N/A, build profile only
  • No secrets, credentials, or .env files included
  • Breaking changes documented, none; dev-only codegen quality, no API/behavior change

Link to Devin session: https://app.devin.ai/sessions/389efda907324a53bdd07ef9f4f29802
Open in Devin Desktop: https://app.devin.ai/desktop/session/389efda907324a53bdd07ef9f4f29802?variant=devin
Requested by: @ScriptedAlchemy

Link to Devin session: https://app.devin.ai/sessions/d1c43c1ea5264a0e9398d1b722b54447
Open in Devin Desktop: https://app.devin.ai/desktop/session/d1c43c1ea5264a0e9398d1b722b54447?variant=devin


Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@changeset-bot

changeset-bot Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 49c1344

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@ScriptedAlchemy
ScriptedAlchemy merged commit 1ea926f into master Oct 5, 2026
15 of 25 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the devin/1791144987-dev-opt0-nonkernel branch October 5, 2026 08:11
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