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: strip for release build #6765

Merged

Conversation

Corwinpro
Copy link
Contributor

Motivation for features / changes

Potential improvement to the build: reduce the binary size by ~5Mb

Technical description of changes

Run strip on release build so that [whatever strip does to the binary] is not shipped in the production build.

Screenshots of UI changes (or N/A)

Detailed steps to verify changes work correctly (as executed by you)

Run cargo build --release, with and without the change, to observe the binary size (as tested on M1 Mac) reducing from 14Mb to 9.5Mb

Alternate designs / implementations considered (or N/A)

Copy link
Collaborator

@bileschi bileschi left a comment

Choose a reason for hiding this comment

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

Thanks! We didn't spend much time trying to optimize size, but this seems like a net win.

@bileschi bileschi merged commit 0c5523f into tensorflow:master Feb 27, 2024
13 checks passed
@Corwinpro Corwinpro deleted the petr.kungurtsev/dev/strip-release-build branch February 27, 2024 22:13
@Corwinpro
Copy link
Contributor Author

Just for posterity:

strip = true is equivalent to strip = "symbols":

debuginfo - debuginfo sections and debuginfo symbols from the symbol table section are stripped at link time and are not copied to the produced binary or separate files.
symbols - same as debuginfo, but the rest of the symbol table section is stripped as well if the linker supports it.

AnuarTB pushed a commit to AnuarTB/tensorboard that referenced this pull request May 3, 2024
## Motivation for features / changes

Potential improvement to the build: reduce the binary size by ~5Mb

## Technical description of changes

Run `strip` on release build so that [whatever strip does to the binary]
is not shipped in the production build.

## Screenshots of UI changes (or N/A)

## Detailed steps to verify changes work correctly (as executed by you)

Run `cargo build --release`, with and without the change, to observe the
binary size (as tested on M1 Mac) reducing from 14Mb to 9.5Mb

## Alternate designs / implementations considered (or N/A)
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.

None yet

2 participants