Stop rebuilding all 262k lines for a one-line edit

There was no slow flag to remove: the release profile was Cargo's default,
and that default turns incremental compilation off. With one crate this
large, that makes every rebuild a full rebuild.

Measured on an idle machine:

  one-line source edit, rebuild    24.97s -> 1.67s
  cold build                       24.02s -> 23.37s
  300 corpus modules x4 translated  46.6s -> 46.2s

So the edit-rebuild loop gets ~15x shorter, and neither the cold build nor
translation throughput moves. The throughput figure is repeatable to within
0.5s run to run, so the per-translation budget in AGENTS.md is untouched.

Profiles only apply from the workspace root, so this changes how the repo
builds itself and nothing about how a consumer builds the published crate.
This commit is contained in:
Anees Iqbal committed 2026-08-31 16:06:41 +03:00
1 parent 6c4f33f3ee
commit b2b563d414
1 file changed
+14
+14
View File
@@ -70,3 +70,17 @@ serde_json = "1"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
# Cargo's default release profile turns incremental compilation OFF, which means every rebuild of
# this crate is a full rebuild of all ~262k lines of it. That is the whole cost: measured on an idle
# machine, a one-line source edit cost 24.97s to rebuild without incremental and 1.67s with it.
#
# It buys that back for nothing measurable. A cold build is unchanged (23.4s incremental vs 24.0s
# not), and translation throughput is unchanged: 300 corpus modules translated four times each took
# 46.2s incremental against 46.6s not, run to run repeatable to within 0.5s. The 20-second/500 MiB
# per-translation contract in AGENTS.md is unaffected.
#
# Profile settings only apply to builds whose workspace root this is, so this changes how the repo
# builds itself and nothing about how a consumer builds the published crate.
[profile.release]
incremental = true