Skip to content

Huge binary size regression at nightly-2025-01-03 #139950

Closed
@mikialex

Description

@mikialex

I observed a huge binary size regression in my project when updating the rust version to nightly-2025-01-03.

My project repo is https://github.com/mikialex/rendiation, and the build command is using cargo build --bin viewer --release. The typical release build of the viewer binary is 16.6mb(in master), but for any rust version after(include) nightly-2025-01-03, the binary size regressed to 29mb, nearly doubled.

I also compare the lto=true codegen-unit=1 release config, the master version yields a 14.8mb binary, but the regressed version yields a 21.4mb binary.

To reproduce this issue, simply go to the project's root, modify the rust-toolchain.toml the channel "nightly-2025-01-04"(I don't known why it's 04 not 03). It's not a small project(95k loc), I will continue trying to find simpler ways to reproduce.

Version it worked on

before rustc 1.85.0-nightly (4363f9b 2025-01-02)

It most recently worked on:

Version with regression

before rustc 1.85.0-nightly (3f43b1a 2025-01-03)

rustc --version --verbose:

rustc 1.86.0-nightly (3f43b1a63 2025-01-03)
binary: rustc
commit-hash: 3f43b1a636738f41c48df073c5bcb97a97bf8459
commit-date: 2025-01-03
host: aarch64-apple-darwin
release: 1.86.0-nightly
LLVM version: 19.1.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.O-appleOperating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions