Giter VIP home page Giter VIP logo

Comments (6)

RazrFalcon avatar RazrFalcon commented on June 24, 2024

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.

from cargo-bloat.

vimmerru avatar vimmerru commented on June 24, 2024

@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.

from cargo-bloat.

RazrFalcon avatar RazrFalcon commented on June 24, 2024

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.

from cargo-bloat.

vimmerru avatar vimmerru commented on June 24, 2024

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

image

Maybe other sections size correlates to text section size too.

from cargo-bloat.

RazrFalcon avatar RazrFalcon commented on June 24, 2024

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

from cargo-bloat.

vimmerru avatar vimmerru commented on June 24, 2024

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!

from cargo-bloat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.