hzgrow-r502 icon indicating copy to clipboard operation
hzgrow-r502 copied to clipboard

Relatively large code size when compiled for thumbv7em

Open FLamparski opened this issue 5 years ago • 0 comments

Some top items from cargo-bloat in an example stm32f4 project for this crate:

File  .text    Size                           Crate Name
0.0%   3.5%  1.6KiB                     hzgrow_r502 <hzgrow_r502::commands::Command as hzgrow_r502::utils::ToPayload>::to_payload
0.0%   3.5%  1.6KiB                   stm32f4xx_hal stm32f4xx_hal::rcc::CFGR::freeze
0.0%   2.6%  1.2KiB                     hzgrow_r502 hzgrow_r502::driver::R502<TX,RX>::parse_reply
0.0%   1.9%    884B                     hzgrow_r502 hzgrow_r502::driver::R502<TX,RX>::read_reply
0.0%   1.7%    816B                             std core::char::methods::<impl char>::encode_utf8
0.0%   1.7%    802B                             std core::str::slice_error_fail
0.0%   1.6%    728B                             std core::fmt::Formatter::pad
0.0%   1.5%    704B                     hzgrow_r502 hzgrow_r502::driver::R502<TX,RX>::send_command
0.0%   1.4%    670B stm32f446_fingerprint_detection stm32f446_fingerprint_detection::__cortex_m_rt_main

to_payload should clearly be improved here, also because of repetitive code therein.

FLamparski avatar Dec 17 '19 19:12 FLamparski