Skip to content

Explore binary overhead in mixed Rust + C/C++ projects #101

@mean00

Description

@mean00

Hi
First of all thank you for this nice project.
I was looking at it with the goal of embedding it on a small arm or riscv board and talk to it over usb/cdc.

  • Arm support : check
  • Riscv support : check
  • No_std : check
  • Simple to use API: check

So far it looked like a perfect match
But then i tried to build the no_std example on top of my project baseline, that is a mix of C++ and rust. The base project is ~ 20 kB binary size.

It built find, except it consumed a metric ton of flash (i guess this is all relative :) ) .
With a lazy setup i was around 600 kB, using all the tricks i now it went down to ~ 200 kB.

I've looked into the why, ~ 80 kB or so is gdbstub/_arch itself, ~ 120 kB is pulling dependencies from core, fmt,...
In the example, calling gdb.incoming_data(&mut target, byte) is enough for the final executable to jump from 20k to 220 kB
(binary size), as the code is no longer tagged as not used and is not removed.

So a couple of questions :

  • Is it the size expected for the no_std version ? or did i make something silly ?
  • Do you have any hint how to shrink it down ?

Thank you again

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions