rust-exercises icon indicating copy to clipboard operation
rust-exercises copied to clipboard

Cargo bloat issue

Open plaindocs opened this issue 1 year ago • 0 comments

When I run cargo bloat --bin hello, following http://localhost:3001/nrf52-tooltips.html I get a pretty different output. Is this just OS differences (Fedora Linux) or a sign that something isn't quite right?

❯ cargo bloat --bin hello
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.06s
    Analyzing target/thumbv7em-none-eabihf/debug/hello

File  .text   Size          Crate Name
0.4%  29.9% 1.6KiB            std <&T as core::fmt::Display>::fmt
0.1%  10.6%   562B            std core::fmt::num::imp::<impl core::fmt::Display for u32>::fmt
0.1%   6.9%   368B          hello hello::__cortex_m_rt_main
0.1%   6.6%   350B            std core::fmt::write
0.1%   6.2%   328B            std compiler_builtins::mem::memcpy
0.0%   3.0%   160B      defmt_rtt _defmt_write
0.0%   2.6%   140B    panic_probe <&T as core::fmt::Display>::fmt
0.0%   2.6%   138B          defmt core::fmt::Write::write_char
0.0%   2.5%   134B      defmt_rtt defmt_rtt::channel::Channel::write_impl
0.0%   2.3%   124B    panic_probe rust_begin_unwind
0.0%   1.8%    98B            std core::result::unwrap_failed
0.0%   1.5%    80B      defmt_rtt _defmt_acquire
0.0%   1.5%    80B            std core::ops::function::FnMut::call_mut
0.0%   1.4%    76B      defmt_rtt _defmt_release
0.0%   1.4%    72B             dk nrf_hal_common::gpio::Pin<MODE>::into_push_pull_output
0.0%   1.3%    70B            std core::slice::index::slice_start_index_len_fail
0.0%   1.2%    66B            std core::fmt::Formatter::pad_integral::write_prefix
0.0%   1.2%    64B            std core::panicking::panic_explicit
0.0%   1.2%    62B    cortex_m_rt Reset
0.0%   1.0%    52B nrf_hal_common nrf_hal_common::ieee802154::Radio::wait_for_state_a
0.2%  12.6%   668B                And 38 smaller methods. Use -n N to show more.
1.3% 100.0% 5.2KiB                .text section size, the file size is 390.9KiB

plaindocs avatar Oct 14 '24 10:10 plaindocs