Do you have a reference that explains this in more detail? I thought -g
just added debug information without changing the generated code?

My understanding was that there was debug info added - well, in release mode, it is not worth it, impossible to debug -, and these added data can impact performance in jumps, loading times, ...