diff --git a/Cargo.toml b/Cargo.toml index 2a75d6e..eabff80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,5 +30,11 @@ profile = ["dep:libc"] name = "pce-profile" required-features = ["profile"] +# Whole-program optimisation for this crate's own binaries (the gate's and the bench's): the +# CPU core and the 65xx frame under it are other crates, and every CPU cycle crosses both +# borders. A crate that depends on this one sets its own profile (the browser pages build +# with the same two lines). [profile.release] debug = 1 +lto = "fat" +codegen-units = 1 diff --git a/scripts/seeded_faults.py b/scripts/seeded_faults.py index b43b938..5ff5572 100755 --- a/scripts/seeded_faults.py +++ b/scripts/seeded_faults.py @@ -514,6 +514,8 @@ def main() -> int: manifest = (ROOT / "Cargo.toml").read_text().replace( 'path = "../huc6280-rust"', f'path = "{(ROOT.parent / "huc6280-rust").as_posix()}"' ) + # the same source built without the whole-program pass: a fault costs a third of the build + manifest = manifest.replace('lto = "fat"\ncodegen-units = 1\n', "") (tree / "Cargo.toml").write_text(manifest) shutil.copy(ROOT / "Cargo.lock", tree / "Cargo.lock") source = tree / "src" / file