Build: fat LTO and one codegen unit for release (#398) #466

Closed
kayg wants to merge 0 commits from issue/398-lto into dev
Owner

Part of #398: how far a smaller binary moves idle RSS. This is the only build change that kept speed within noise. Based on current dev.

[profile.release] gets lto = "fat" and codegen-units = 1.

Numbers, perf VM, 100k notes

  • Memory: idle memory split, 3 starts each (warm Home, 90 s idle).
  • Latency: 4 to 5 interleaved harness runs each. One opt-level 3 run that collided with another agent's work is left out.
opt-level 3 (today) + fat LTO + 1 codegen unit
binary on disk MB 24.8 17.6
binary's resident code MB 11.0 9.4
file-backed RSS MB 14.7 13.2
idle.rss MB (harness) 41.0 39.0
search.query p50 / p95 ms 5.3 / 19.2 4.3 / 17.2
open.note p95 ms 2.9 3.5 (runs 2.4–6.2, noise)
cold.index s 22.5 23.4 (runs 17.1–31.5, noise)
storm edits/s 2,556 3,435
sync.save_ack p95 ms 8.0 5.8
release build, staging s 103 157

Anonymous memory varies by ±6 MB between starts with the same binary, so only the file-backed column is a clean comparison.

Not done, and why

option file-backed RSS binary cost
opt-level = "s" 12.5 MB 22.7 MB cold.index 23–39 s against 19 s: 40–60% slower
"s" + fat LTO + strip 10.9 MB 10.6 MB cold.index 24–32 s, slower
panic = "abort" 13.4 MB 19.6 MB speed the same, but any panic in one request would crash the whole server, and saves that run on drop would be skipped
strip = "symbols" unchanged −6 MB on disk symbols aren't mapped, so RSS doesn't move; backtraces and profiles of release builds lose function names
rustls instead of OpenSSL — — not applicable: only webauthn-rs uses OpenSSL, for passkey signature checks, not TLS. Dropping it means replacing the passkey library

Checks: only the release profile changes; cargo build --release --locked passes on staging.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

Part of #398: how far a smaller binary moves idle RSS. This is the only build change that kept speed within noise. **Based on current dev.** `[profile.release]` gets `lto = "fat"` and `codegen-units = 1`. ## Numbers, perf VM, 100k notes - **Memory:** idle memory split, 3 starts each (warm Home, 90 s idle). - **Latency:** 4 to 5 interleaved harness runs each. One `opt-level 3` run that collided with another agent's work is left out. | | opt-level 3 (today) | **+ fat LTO + 1 codegen unit** | |---|---|---| | binary on disk MB | 24.8 | 17.6 | | binary's resident code MB | 11.0 | 9.4 | | file-backed RSS MB | 14.7 | 13.2 | | idle.rss MB (harness) | 41.0 | 39.0 | | search.query p50 / p95 ms | 5.3 / 19.2 | 4.3 / 17.2 | | open.note p95 ms | 2.9 | 3.5 (runs 2.4–6.2, noise) | | cold.index s | 22.5 | 23.4 (runs 17.1–31.5, noise) | | storm edits/s | 2,556 | 3,435 | | sync.save_ack p95 ms | 8.0 | 5.8 | | release build, staging s | 103 | 157 | Anonymous memory varies by ±6 MB between starts with the same binary, so only the file-backed column is a clean comparison. ## Not done, and why | option | file-backed RSS | binary | cost | |---|---|---|---| | `opt-level = "s"` | 12.5 MB | 22.7 MB | cold.index 23–39 s against 19 s: **40–60% slower** | | `"s"` + fat LTO + strip | 10.9 MB | 10.6 MB | cold.index 24–32 s, slower | | `panic = "abort"` | 13.4 MB | 19.6 MB | speed the same, but any panic in one request would crash the whole server, and saves that run on drop would be skipped | | `strip = "symbols"` | unchanged | −6 MB on disk | symbols aren't mapped, so RSS doesn't move; backtraces and profiles of release builds lose function names | | rustls instead of OpenSSL | — | — | not applicable: only `webauthn-rs` uses OpenSSL, for passkey signature checks, not TLS. Dropping it means replacing the passkey library | Checks: only the release profile changes; `cargo build --release --locked` passes on staging. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Build: fat LTO and one codegen unit for release (#398)
Some checks failed
CI / server (pull_request) Successful in 24s
CI / rust (pull_request) Successful in 1m58s
CI / web (pull_request) Failing after 43m30s
3a6cb70b75
Perf VM, 100k notes, 4-5 interleaved runs each, opt-level 3 against
opt-level 3 + fat LTO + codegen-units 1 (p50 of runs):

- binary 24.8 -> 17.6 MB on disk; its resident code 11.0 -> 9.4 MB,
  file-backed RSS 14.7 -> 13.2 MB
- search.query p50 5.3 -> 4.3 ms, p95 19.2 -> 17.2 ms
- open.note p95 2.9 -> 3.5 ms, cold.index 22.5 -> 23.4 s (both noise)
- storm 2,556 -> 3,435 edits/s, save ack p95 8.0 -> 5.8 ms
- release build 103 -> 157 s on staging

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Author
Owner

Landed in dev via train p.

Landed in dev via train p.
kayg closed this pull request 2026-10-16 03:17:26 +00:00
Some checks failed
CI / server (pull_request) Successful in 24s
CI / rust (pull_request) Successful in 1m58s
CI / web (pull_request) Failing after 43m30s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!466
No description provided.