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

Strip symbols of inferno binaries to decrease size by 24x #310

Merged
merged 2 commits into from
Nov 25, 2023

Conversation

marcospb19
Copy link
Contributor

@marcospb19 marcospb19 commented Nov 25, 2023

After running cargo install --path . to install all inferno binaries, here's what I noticed:

 ~ du -hc .cargo/bin/inferno-*
28M .cargo/bin/inferno-collapse-dtrace
25M .cargo/bin/inferno-collapse-ghcprof
30M .cargo/bin/inferno-collapse-guess
29M .cargo/bin/inferno-collapse-perf
27M .cargo/bin/inferno-collapse-recursive
25M .cargo/bin/inferno-collapse-sample
25M .cargo/bin/inferno-collapse-vsprof
25M .cargo/bin/inferno-collapse-vtune
24M .cargo/bin/inferno-diff-folded
28M .cargo/bin/inferno-flamegraph
263M    total

Files were extremely large due to this debug value:

[profile.release]
debug = true

Here are the values after stripping (with strip binary or key in manifest file):

 ~ du -hc .cargo/bin/inferno-*
1.2M    .cargo/bin/inferno-collapse-dtrace
1.1M    .cargo/bin/inferno-collapse-ghcprof
1.4M    .cargo/bin/inferno-collapse-guess
1.2M    .cargo/bin/inferno-collapse-perf
1.1M    .cargo/bin/inferno-collapse-recursive
1012K   .cargo/bin/inferno-collapse-sample
1000K   .cargo/bin/inferno-collapse-vsprof
1020K   .cargo/bin/inferno-collapse-vtune
932K    .cargo/bin/inferno-diff-folded
1.4M    .cargo/bin/inferno-flamegraph
11M total

And here's what you get by not using debug or strip:

 ~ du -hc .cargo/bin/inferno-*
5.6M    .cargo/bin/inferno-collapse-dtrace
5.4M    .cargo/bin/inferno-collapse-ghcprof
5.8M    .cargo/bin/inferno-collapse-guess
5.6M    .cargo/bin/inferno-collapse-perf
5.5M    .cargo/bin/inferno-collapse-recursive
5.4M    .cargo/bin/inferno-collapse-sample
5.3M    .cargo/bin/inferno-collapse-vsprof
5.4M    .cargo/bin/inferno-collapse-vtune
5.3M    .cargo/bin/inferno-diff-folded
5.8M    .cargo/bin/inferno-flamegraph
55M total

TLDR

debug (current) none strip
263M 55M 11M

So I added strip = true

Cargo.toml Show resolved Hide resolved
jonhoo
jonhoo previously approved these changes Nov 25, 2023
Copy link
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

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

Great spot, thank you! Would you mind also updating CHANGELOG.md and I'll make a release?

Copy link

codecov bot commented Nov 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (86131d4) 91.06% compared to head (e2c0aea) 91.06%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #310      +/-   ##
==========================================
- Coverage   91.06%   91.06%   -0.01%     
==========================================
  Files          20       20              
  Lines        4500     4498       -2     
==========================================
- Hits         4098     4096       -2     
  Misses        402      402              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marcospb19
Copy link
Contributor Author

Of course :) done.

Copy link
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

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

Thanks!

@jonhoo jonhoo merged commit d877809 into jonhoo:main Nov 25, 2023
15 of 16 checks passed
@jonhoo
Copy link
Owner

jonhoo commented Nov 25, 2023

Released in 0.11.19 🎉

@marcospb19 marcospb19 deleted the strip-binary-symbols branch November 25, 2023 16:01
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.

2 participants