Skip to content

fix(1785): enable lto and codegen-units in release build#6586

Merged
jh-block merged 1 commit intoblock:mainfrom
lsytj0413:fix-1785
Feb 4, 2026
Merged

fix(1785): enable lto and codegen-units in release build#6586
jh-block merged 1 commit intoblock:mainfrom
lsytj0413:fix-1785

Conversation

@lsytj0413
Copy link
Contributor

@lsytj0413 lsytj0413 commented Jan 20, 2026

Summary

binary size:

  • release:goose 126M,goosed 113M
  • release + lto + codegen-units:goose 90M,goosed 81M

build time:

  • release: 6m26.735s
  • relase + lto + codegen-units: 12m29.807s

Fix: #1785

Type of Change

  • Feature

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Related Issues

Relates to #ISSUE_ID
Discussion: LINK (if any)

Screenshots/Demos (for UX changes)

Before:

After:

Signed-off-by: lsytj0413 <511121939@qq.com>
@lsytj0413
Copy link
Contributor Author

@michaelneale could you please take a look at this pr?

@lsytj0413
Copy link
Contributor Author

@lifeizhou-ap could you please take a look at this pr?


[profile.release]
codegen-units = 1
lto = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, it will be good to have a more optimised release build. I think it would be better to use lto = "thin" here, what do you think? ThinLTO achieves optimisation results very close to "fat" LTO but with substantially less build time penalty

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I see in the linked issue that all three were compared and fat LTO is doing better at reducing binary size. I'll merge this as-is for now and if build times become an issue we can revisit. Thanks again!

@jh-block jh-block added this pull request to the merge queue Feb 4, 2026
Merged via the queue into block:main with commit 79088db Feb 4, 2026
18 checks passed
@lsytj0413 lsytj0413 deleted the fix-1785 branch February 4, 2026 14:11
stebbins pushed a commit to stebbins/goose that referenced this pull request Feb 4, 2026
Signed-off-by: lsytj0413 <511121939@qq.com>
Signed-off-by: Harrison <hcstebbins@gmail.com>
jamadeo added a commit that referenced this pull request Feb 5, 2026
kuccello pushed a commit to kuccello/goose that referenced this pull request Feb 7, 2026
Tyler-Hardin pushed a commit to Tyler-Hardin/goose that referenced this pull request Feb 11, 2026
Tyler-Hardin pushed a commit to Tyler-Hardin/goose that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Link-Time Optimization (LTO) and codegen-units = 1

2 participants