Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default test binary #101

Open
PSeitz opened this issue Nov 23, 2023 · 3 comments
Open

Default test binary #101

PSeitz opened this issue Nov 23, 2023 · 3 comments

Comments

@PSeitz
Copy link

PSeitz commented Nov 23, 2023

It would be nice to bloat check the default cargo test binary. It would allow to analyze bloat to reduce compile times.

You could also do a release build, that would probably cover more than some superficial binary. There would be some noise due to dev-dependencies though.

Similar to #67

@RazrFalcon
Copy link
Owner

cargo bloat isn't really useful to reduce compilation times. And checking bloat of tests is mostly pointless as well.
cargo bloat is useful only when checking release builds of executables.

@PSeitz
Copy link
Author

PSeitz commented Nov 26, 2023

cargo bloat isn't really useful to reduce compilation times.

Your reddit post would suggest otherwise :)
https://old.reddit.com/r/rust/comments/cg3p5m/cargobloat_08_debloated_5x_smaller_10x_faster/

And checking bloat of tests is mostly pointless as well.

I have to clean my rust projects regularly, because the fill up my disk >100GB.
E.g. one test binary is 267MB large and I'm just wondering, which crates to attribute it to.

@RazrFalcon
Copy link
Owner

Your reddit post would suggest otherwise

That post it 4 years old. You have to use cargo build --timings instead.

E.g. one test binary is 267MB large and I'm just wondering, which crates to attribute it to.

cargo bloat doesn't check build artifacts, only the final binary. It a very different statistics.

Also, aren't you already can check tests? Simply use cargo bloat --test NAME. Not sure how hard would be to detect the "default test".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants