Optimization should not affect the actions of the program. Therefore, no type of optimization should affect the I / O network used by the program, and something else in this regard. If your program sends 10 kilobytes, it will send the same even after optimization.
Optimization may affect how structsaligned among other things (for example, code size, memory usage, etc.), but will not affect the logic at all (if programmed correctly).
Typically, since binaries tend to be relatively small (a 1 MB binary is extremely large), optimization is often used for speed rather than size. However, it is up to you.
source
share