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

What are the rest 74% not covered by output? #60

Closed
vimmerru opened this issue Aug 31, 2020 · 6 comments
Closed

What are the rest 74% not covered by output? #60

vimmerru opened this issue Aug 31, 2020 · 6 comments

Comments

@vimmerru
Copy link

Hi,

If just aggregate output from README.md it will be 26,2% in total only. What are the rest 74% not covered by output?

See attached screenshot

Screen Shot 2020-08-31 at 16 21 38

@RazrFalcon
Copy link
Owner

cargo-bloat parser only the .text section. There are many more sections, which are more or less optional/irrelevant. Here is a list of sections for ELF.

As for 26.2%, the last row is total. So 13.3% is a .text section size in the file. As mentioned in the Name column.

@vimmerru
Copy link
Author

@RazrFalcon Yea... understand. Thanks for the explanation, but seems size analysis based on "text" section only doesn't help a lot in optimization as there is very limited correlation between total size and text section size.

@RazrFalcon
Copy link
Owner

RazrFalcon commented Aug 31, 2020

All other sections are optional. Only the .text section contains your code. You can run strip on Linux and similar commands on other OS'es and most of the sections will be removed.

On the other hand, cargo-bloat indeed doesn't support static variables yet. But it should not affect the results in most cases.

PS: by the way, the original version of cargo-bloat didn't have the File column at all. I've added it only because someone asked for it. So cargo-bloat is designed just for "code size", not "binary size" analysis in mind.

@vimmerru
Copy link
Author

In my specific case i got the following after strip. Text is 55%

image

Maybe other sections size correlates to text section size too.

@RazrFalcon
Copy link
Owner

350KiB for .rodata is a lot... And as mentioned, cargo-bloat doesn't supports constant/static data yet. This is basically #10

@vimmerru
Copy link
Author

This is basically #10

I agree. Feel free to close the issue. I got the answers. Maybe a bit of explanation in readme will help. Thanks!

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

No branches or pull requests

2 participants