Skip to content

Is core::fmt::float poorly optimized on thumbv7em-none-eabihf or is the binary analysis tooling incorrect? #118337

Open

Description

Adding formatting output (write) for float numbers for Cortex M4F increase binary size twice: from 39396 bytes to 66468 bytes. (optimisation flag: z)
The main high weigh functions are (provided by cargo bloat):

2.4%  22.7% 11.2KiB             std core::fmt::float::float_to_decimal_common_shortest
1.9%  17.8%  8.8KiB             std core::fmt::float::float_to_decimal_common_exact
0.9%   8.6%  4.2KiB             std core::num::dec2flt::<impl core::str::traits::FromStr for f32>::from_str
0.4%   3.8%  1.9KiB             std core::fmt::Formatter::pad

and others

For desktop application (Apple M2Pro chip, native build) with same functions size lower than few kilobytes:

 0.1%   0.3%     732B         std core::fmt::float::float_to_decimal_common_exact
 0.1%   0.3%     624B         std core::fmt::float::float_to_decimal_common_shortest
  0.3%   0.6%   1.3KiB         std core::num::dec2flt::<impl core::str::traits::FromStr for f32>::from_str
 0.2%   0.4%     980B         std core::fmt::Formatter::pad

Which reason of overweigh these functions for Cortex-M4F?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationArea: Code generationI-heavyIssue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to binary size of generated code.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateS-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.Status: This issue has no reproduction and needs a reproduction to make progress.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions