After cargo build --release on Windows with only the counter example, the release folder is 459MB.
Am I missing something?
I am not a rust compiler expert but I think the release folder size is not very relevant here. It contains many dependencies, libs and intermediate compiler representations.
You might want to check check the final binary size in target/release/{my_binary_name}. I don't know the exact path on windows but I am quite sure it's the same (with backslashes).
After that if you still think your binary is too large you can investigate further. There are numerous article and blog posts on how to do this : https://github.com/johnthagen/min-sized-rust
I hope this answer your question.
Most helpful comment
I am not a rust compiler expert but I think the release folder size is not very relevant here. It contains many dependencies, libs and intermediate compiler representations.
You might want to check check the final binary size in
target/release/{my_binary_name}. I don't know the exact path on windows but I am quite sure it's the same (with backslashes).After that if you still think your binary is too large you can investigate further. There are numerous article and blog posts on how to do this : https://github.com/johnthagen/min-sized-rust
I hope this answer your question.