5 ms·
> There’s also an effort to analyze binary sizes more systematically. I applaud such efforts and would love it if they were even more visible. Ideally, crates.i
by weinzierl 7y ago
> There’s also an effort to analyze binary sizes more systematically. I applaud such efforts and would love it if they were even more visible. Ideally, crates.io would include some kind of bloat report along with its other metadata, [...]
This is what I always wanted (for Rust as well as for C) but never got around to hack together myself. I dreamt it up more as a feature of cargo though, something like 'cargo stats' or so. Shouldn't be to hard and cargo is extensible.
- dmix 7y agoFor NPM they should make it optionally inverted to highlight the one line node packages that you can get rid of!
- sitkack 7y agoYou might be looking for `cargo install cargo-bloat` $ cargo bloat Compiling ... Analyzing target/debug/mdbook File .text Size Crate Name 0.5% 1.3% 166.4KiB regex <regex::exec::ExecNoSync as regex::re_trait::RegularExpression>::captures_read_at 0.5% 1.3% 165.2KiB idna unicode_normalization::tables::compatibility_fully_decomposed 0.3% 0.7% 95.0KiB ammonia html5ever::tree_builder::TreeBuilder<Handle,Sink>::step 0.3% 0.7% 92.5KiB idna unicode_normalization::tables::canonical_fully_decomposed 0.2% 0.5% 64.6KiB unicase unicase::unicode::map::lookup 0.2% 0.5% 63.4KiB idna unicode_normalization::tables::is_combining_mark 0.2% 0.4% 55.8KiB regex <regex::re_trait::Matches<R> as core::iter::traits::iterator::Iterator>::next 0.2% 0.4% 55.5KiB regex regex::re_unicode::Regex::find_at 0.1% 0.3% 41.7KiB unicode_normalization unicode_normalization::tables::composition_table 0.1% 0.3% 36.2KiB rand_hc rand_hc::hc128::Hc128Core::sixteen_steps 0.1% 0.3% 33.8KiB regex regex::re_unicode::Regex::shortest_match_at 0.1% 0.3% 32.4KiB rand_hc <rand_hc::hc128::Hc128Core as rand_core::block::BlockRngCore>::generate 0.1% 0.2% 31.4KiB ammonia html5ever::tokenizer::Tokenizer<Sink>::step 0.1% 0.2% 24.5KiB idna unicode_normalization::tables::canonical_combining_class 0.1% 0.2% 21.8KiB regex aho_corasick::ahocorasick::AhoCorasick<S>::find 0.1% 0.2% 21.6KiB regex aho_corasick::ahocorasick::AhoCorasick<S>::find 0.1% 0.2% 21.0KiB clap clap::app::parser::Parser::get_matches_with 0.1% 0.2% 20.3KiB ws ws::io::Handler<F>::handle_queue 0.1% 0.1% 19.0KiB ws ws::connection::Connection<H>::read_frames 0.1% 0.1% 18.7KiB env_logger termcolor::Ansi<W>::write_color 35.3% 91.6% 11.4MiB And 58189 smaller methods. Use -n N to show more. 38.6% 100.0% 12.5MiB .text section size, the file size is 32.4MiB