Commit 611434f
committed
perf: enable thin LTO and single codegen unit for release builds
Release builds ran on cargo's defaults (16 codegen units, no LTO), so the
optimizer never saw across crate boundaries. The hot paths are spread over
several workspace crates and their dependencies -- SSZ encode/decode, hashing,
fork choice traversal -- which is exactly the shape that loses the most to
per-crate codegen units.
Adopt the same release profile ethrex uses: opt-level 3, thin LTO, one codegen
unit.
Clean `cargo build --release --bin ethlambda`, aarch64-apple-darwin, 11 cores,
isolated target dirs:
wall CPU binary
before 315.9s 1714s 30.6 MiB
after 377.8s 1516s 26.6 MiB
+20% -12% -13%
Wall clock grows because a single codegen unit serializes per-crate codegen,
even though total CPU work drops. CI's test job builds in release, so its
cold-cache builds get the same increase.
Runtime effect is not measured here: the repo has no benchmarks, and the
meaningful comparison (block build and aggregation latency) needs a devnet A/B.1 parent 4daf481 commit 611434f
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
29 | 39 | | |
30 | 40 | | |
31 | 41 | | |
| |||
0 commit comments