Debug compilation considerably increases memory footprint since debug symbols are required to be loaded.
Additionally it will hit the performance because that will include the optional debug and trace statements in the output IL code.
In debug mode the compiler emits debug symbols for all variables and compiles the code as is. In release mode some optimizations are included:
The rest is up to the JIT.
As per: C# debug vs release performance.
❌ Figure: Bad Example
✅ Figure: Good Example
We have a program called SSW Code Auditor to check for this rule.