Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(ci): optimize Cargo release for program #626

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

Rudxain
Copy link
Member

@Rudxain Rudxain commented Sep 15, 2024

Copy link
Contributor

deepsource-io bot commented Sep 15, 2024

Here's the code health analysis summary for commits 4b12d03..1b3e1f3. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Rust LogoRust✅ SuccessView Check ↗
DeepSource Test coverage LogoTest coverage⚠️ Artifact not reportedTimed out: Artifact was never reportedView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@AnonymousWP AnonymousWP changed the title build(Cargo): optimize release further build(ci): optimize release further for Cargo Sep 15, 2024
@AnonymousWP AnonymousWP requested a review from a team September 15, 2024 15:30
@AnonymousWP AnonymousWP added the testing Validation and tests label Sep 15, 2024
Cargo.toml Show resolved Hide resolved
@Rudxain

This comment was marked as off-topic.

@AnonymousWP
Copy link
Member

Because the Cargo.toml is used when building the assets, right? And assets are being build when a tag is pushed for a new version.🙂 Let me know if that way of thinking is incorrect.

@Rudxain

This comment was marked as off-topic.

@@ -46,8 +46,10 @@ win32console = "^0.1.5"

[profile.release]
opt-level = "s"
codegen-units = 1
Copy link
Contributor

Choose a reason for hiding this comment

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

This is sure to lead to much slower code. IMO remove this line, it doesn't really help much with executable sizes, so let it be at the default of 16.

Copy link
Member Author

Choose a reason for hiding this comment

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

I could only find this rust-lang/rust#47745 , but I'm not sure how to interpret all the linked issues 😕

Should we set it to 4 instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that's specific to lto="thin", which we don't use. We don't have any benchmarks for code performance, so the only test we can do is build with and without defaults codegen values, and compare file sizes.

Cargo.toml Show resolved Hide resolved
@adhirajsinghchauhan
Copy link
Contributor

I'm interested to see the size differences between panic unwind and abort. Could you post comparisons by building the latest release with both options?

@Rudxain Rudxain changed the title build(ci): optimize release further for Cargo build(ci): optimize Cargo release for program Sep 15, 2024
@Rudxain
Copy link
Member Author

Rudxain commented Sep 15, 2024

cargo build --release; stat -c%s target/release/uad-ng on 3 branches:

  • main 16261816
  • build/opt-release 14346792
  • default-codegen-units (local) 14748040

env:

  • cargo 1.81.0 (2dbb1af80 2024-08-20)
  • apt-cache show clang | grep Version: | cut -d' ' -f2 1:16.0-58.1
  • apt-cache show mold | grep Version: | cut -d' ' -f2 2.33.0+dfsg-1
  • 4 logical CPU cores

@AnonymousWP AnonymousWP requested a review from a team September 18, 2024 13:02
@adhirajsinghchauhan adhirajsinghchauhan merged commit a04d597 into main Sep 18, 2024
20 of 21 checks passed
@adhirajsinghchauhan adhirajsinghchauhan deleted the build/opt-release branch September 18, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Validation and tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants