From b2b563d41435239f8fa4e0392d43f3363cfd0462 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Mon, 31 Aug 2026 16:06:41 +0300 Subject: [PATCH] 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. --- Cargo.toml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 31e00adf8..73d792ca2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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