Auto debloat unused pub items from dependencies

PressRex profile image
by PressRex
Auto debloat unused pub items from dependencies

I shaved off 10 MiB from my binary in 2 hours!

I made a program using Macroquad, then I built it in release mode, the binary was 63 MiB in size.

So I used cargo vendor to have a better look at Macroquad and one of its dependencies, glam.

I then started to delete code, like, lots and lots of code(about 30_000 lines of code); none of it affected my main project.

The result is that my project was unaffected and the binary went down to 52 MiB.

As it currently stands, the Rust compiler doesn't flag unused pub items as dead code, even when building a binary crate.

Is there a way to automate removal of unneeded elements from dependencies? This is potentially huge.

Link to Lemmy version of this post

2 posts - 1 participant

Read full topic

Source: View source

PressRex profile image
by PressRex

Subscribe to New Posts

Lorem ultrices malesuada sapien amet pulvinar quis. Feugiat etiam ullamcorper pharetra vitae nibh enim vel.

Success! Now Check Your Email

To complete Subscribe, click the confirmation link in your inbox. If it doesn’t arrive within 3 minutes, check your spam folder.

Ok, Thanks

Read More