[infra] add --debug install path for fast dev iteration (5-10× faster than --release) #189
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_skills#189
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add a
--debug(or--dev) mode toservice_X install(andservice_install_all) that builds with cargo's dev profile instead of--release. Production-bound deploys keep using--release(current default); developer iteration uses--debug. 5-10× faster dev cycles because dev profile drops:lto = true(link-time optimization, single-threaded link)codegen-units = 1(per-crate codegen on one thread)opt-level = 3(aggressive optimization passes)These flags are correct for production binaries (smaller, faster runtime), but they're the dominant cost in build time. For dev iteration ("change one line, rebuild, restart, test"), the runtime perf cost of dev profile is irrelevant — what matters is rebuild speed.
Today's behaviour
Every
service_X installbuilds release-profile, even when the operator is iterating on a single line of code in their own service. Per-service rebuild cycles take 30s-5min depending on the service. Over a day of iteration that's 30-60 cumulative minutes spent waiting for codegen.Proposed
Each
service_X.nuinstall command grows a--debugflag (mutually exclusive with--release):svc_installin lib.nu accepts the profile string and invokes:Same structure for
service_install_allandservice_complete(forward--debugthrough).Use cases
service_X install --update --debug— binary swap in seconds, restart and test.service_install_all --update --debug— get the whole stack runnable in 5-10 min instead of 30-60 min.--release(existing default); dev profile binaries are larger and runtime-slower.Tradeoffs
--clear-debug-binscleanup helper.Out of scope
release/debug(e.g. release-with-debuginfo, release-without-LTO). Add later if there's demand.Cross-refs
--debugpath complements it for local iteration).-jdefault + adds sccache + makes nice/ionice opt-in. Independent of this--debugflag.ROI estimate
For "developer changes one line in service_X and wants to test":
Multiplied across multiple iterations per day, this is the difference between "wait 5-10 min for each retry" and "iteration is instant."