Dlls compiled in debug mode should stay in the developmental environment while they're being debugged, improved, stepped-through, and tweaked.
When the dll is ready to be deployed (released) to a high-traffic server—such as a SharePoint TEST, QA, or Production Farm—the dll should be recompiled in release mode.
When in debug mode. . .
- Expect the memory footprint of the process to be enlarged since debug symbols are required to be loaded.
- Expect a substantial performance hit due to the debug and trace statements (System.Diagnostics.DebuggableAttribute) in the output IL code. In debug mode there are several extra instructions added to enable you to set a breakpoint on every source code line a debugger such as Visual Studio.
- Also the code will not be optimized by the compiler. JIT optimizations will be disabled. (IsJitOptimizerEnabled)
In release mode. . .
- all calls to Debug class methods in your code are disabled.
- Code is optimized during the build operation
- You cannot take advantage of any source-code level debugging tools. You cannot set breakpoints.
- Better performance
- Smaller memory footprint