Repository navigation
Tune release codegen for faster/smaller binaries - #9434
Merged
Merged
Conversation
Use thin LTO and four codegen units for release builds. Keep the custom CI profile at its existing codegen setting to preserve its build cost. Co-authored-by: Codex <[email protected]> Signed-off-by: Sanket Kanjalkar <[email protected]>
sanket1729
marked this pull request as ready for review
November 13, 2026 00:55
🔐 Codex Security Review
Review SummaryOverall Risk: NONE
FindingsNo concrete security, correctness, or reliability findings were identified. Notes
Generated by Codex Security Review | |
Give the same-repository replacement a unique head so the closed fork PR's failed review does not appear among its checks. The source tree is unchanged. Co-authored-by: Codex <[email protected]> Signed-off-by: Sanket Kanjalkar <[email protected]>
kazemek21
approved these changes
Nov 13, 2026
kazemek21
left a comment
Contributor
There was a problem hiding this comment.
I reviewed the PR and the Nexus review-tracker notes. Approving with no comments.
Posted by Codex (gpt-6.1-sol) on behalf of kylez
bostonaholic
added a commit
that referenced
this pull request
Nov 13, 2026
Co-authored-by: mboston.Engineer <932d3b6ebea6cc83e091551ae46d1c7e7f8f7d0fa8e9cef5e6facc8544af413b@buzz.block.builderlab.xyz> * origin/main: fix(mobile): require Builderlab consent for existing identities (#8823) feat(mobile): use HTTP/2 on iOS through app-wide URLSessions (#8897) fix(relay): publish a git push only when refs changed; check the protocol by refinement (#9425) fix(mobile): show shared chats under Solo (#9348) chore(release): release Buzz Desktop version 0.5.29 (#9456) feat(mobile): render messages with gpt_markdown 1.3.4 plusparse (#8945) fix(acp): bound observer retention by bytes (#7987) (#9436) Tune release codegen for faster/smaller binaries (#9434) feat(desktop): add dismissible banner pointing to the new buzz app (#9379) fix(mobile): keep publishing presence while the app is open (#9441) feat(mobile): share into Buzz from the iOS share sheet (#9433) fix(mobile): qualify every namesake mention and keep authored mention casing (#9325) fix(mobile): match browser GIF timing in the iOS reaction sheet (#9437) fix(mobile): play short-delay animation frames at browser speed (#9432) buzz-search: read profile names without the profile_name_fields function (#9397) buzz-db: build the community deletion lock key in Rust (#9396) fix(cli): pair for the active community, skip stopped desktops, accept a bare relay host (#9417) test(mobile): run push tests without a gateway dart-define (#9423) fix(mobile): never pop Home when archiving from channel settings (#9387) perf(acp): reduce observer CPU and lock overhead (#9381) Signed-off-by: Matthew Boston <[email protected]>
bostonaholic
added a commit
that referenced
this pull request
Nov 13, 2026
…count-backfill Co-authored-by: mboston.Engineer <932d3b6ebea6cc83e091551ae46d1c7e7f8f7d0fa8e9cef5e6facc8544af413b@buzz.block.builderlab.xyz> * bostonaholic--agent-reply-count: fix(mobile): require Builderlab consent for existing identities (#8823) feat(mobile): use HTTP/2 on iOS through app-wide URLSessions (#8897) fix(relay): publish a git push only when refs changed; check the protocol by refinement (#9425) fix(mobile): show shared chats under Solo (#9348) chore(release): release Buzz Desktop version 0.5.29 (#9456) feat(mobile): render messages with gpt_markdown 1.3.4 plusparse (#8945) fix(acp): bound observer retention by bytes (#7987) (#9436) Tune release codegen for faster/smaller binaries (#9434) feat(desktop): add dismissible banner pointing to the new buzz app (#9379) fix(mobile): keep publishing presence while the app is open (#9441) feat(mobile): share into Buzz from the iOS share sheet (#9433) fix(mobile): qualify every namesake mention and keep authored mention casing (#9325) fix(mobile): match browser GIF timing in the iOS reaction sheet (#9437) fix(mobile): play short-delay animation frames at browser speed (#9432) buzz-search: read profile names without the profile_name_fields function (#9397) buzz-db: build the community deletion lock key in Rust (#9396) fix(cli): pair for the active community, skip stopped desktops, accept a bare relay host (#9417) test(mobile): run push tests without a gateway dart-define (#9423) fix(mobile): never pop Home when archiving from channel settings (#9387) perf(acp): reduce observer CPU and lock overhead (#9381) Signed-off-by: Matthew Boston <[email protected]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #9424 with the same release-profile change on a branch in this repository so the review workflows can run.
Summary
Reduce release codegen units from 16 to 4 and enable thin link-time optimization (LTO). Local measurements show about 7% smaller binaries, with a 14% increase in dependency-cached release rebuild time (+3.1 seconds). Clean release build time was roughly flat.
codegen-units = 4seems like a good balance. With thin LTO fixed, one unit cut stripped sizes a further 7–10%, but increased clean build time by 38% and cached release rebuild time by 67.5%. CPU and Activity trials showed no clear speedup.Fewer codegen units let LLVM optimize larger portions of each crate together. Lower counts typically favor runtime performance and smaller binaries over compilation speed. Thin LTO also enables optimization across crate boundaries. Runtime gains depend on the workload.
Release keeps
opt-level = 3, the highest numeric optimization level and Cargo's existing default. Development builds stay unchanged. Keep the customciprofile at 16 codegen units with LTO off, preserving its existing settings. Sprig keeps its separate size-focused profile. CI jobs that use ordinary--releasewill use the new settings.These measurements cover
buzzandbuzz-acp, not the desktop bundle. The desktop app has its own Cargo workspace; its bundled CLI picks up this change after a pin update. Our end-to-end runtime trials were broadly flat; the measurements below demonstrate the size and build-time tradeoff.Related issue
N/A — no duplicate release LTO/codegen PR found. This PR contains only the profile change and is independent of #9413.
Testing
Baseline versus four codegen units
Compared identical source and lockfile at
b4de4479485fc3d57628ed509ed40c4278e63132, using Rust 1.98.1 on an Apple M5 Max (18 cores, 128 GiB RAM). Both arms usedopt-level=3, disabled incremental compilation and no compiler-cache wrapper. The baseline used LTO off and 16 codegen units; the candidate used thin LTO and four.buzzexecutablebuzz-acpexecutableBuild command:
cargo build --offline --locked --release -p buzz-acp -p buzz-cli --timings. SetCARGO_INCREMENTAL=0,CARGO_PROFILE_RELEASE_LTO=false|thinandCARGO_PROFILE_RELEASE_CODEGEN_UNITS=16|4for each arm, with separateCARGO_TARGET_DIRdirectories. Clean runs used empty build directories in sequential ABBA order, with downloaded dependencies and filesystem caches warm. Rebuilds cleaned onlybuzz-acpandbuzz-clioutside the timed region. Sizes are Cargo-built executables before the desktop packager's stripping step.Stripping copies with
xcrun strip -S -xkept the size benefit:buzzfell from 12.550 to 11.805 MiB (-5.9%), andbuzz-acpfrom 12.360 to 11.501 MiB (-7.0%). This does not measure a signed desktop installer.Both release executables passed
--helpsmoke checks. Profile inspection confirmed the customciandsprigsettings are unchanged.One codegen unit versus four
A separate follow-up compared four versus one on
a314975ce7bf9aa00baebfef874b6e69474a95cf, which includes the merged observer CPU/locking changes (#9381). Both arms used thin LTO,opt-level=3, the same Rust 1.98.1 toolchain and hardware, and identical source and lockfile. This is a separate source snapshot from the first comparison; the tables should not be combined into a three-arm comparison.buzzbuzz-acpBoth sets of binaries were stripped identically with
xcrun strip -S -x. Repeat the build command above withCARGO_PROFILE_RELEASE_LTO=thinandCARGO_PROFILE_RELEASE_CODEGEN_UNITS=4or1, retaining the same cache and ordering controls.All 60 CPU trials and 10 Activity trials passed. The CPU cases exercised production packing and queue ingestion functions; their differences were within run variation. Activity exercised real ACP subprocesses, observer publication, signing/encryption, the browser broker and production UI against a modeled relay. All 500 markers rendered exactly once, and all 2,250 heavy events were delivered. Its one-second publication interval limits visible latency; these local results are not production percentiles.
Generated with AI assistance