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. . .

  1. Expect the memory footprint of the process to be enlarged since debug symbols are required to be loaded.
  2. 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.
  3. Also the code will not be optimized by the compiler. JIT optimizations will be disabled. (IsJitOptimizerEnabled)

In release mode. . .

  1. all calls to Debug class methods in your code are disabled.
  2. Code is optimized during the build operation
  3. You cannot take advantage of any source-code level debugging tools. You cannot set breakpoints.
  4. Better performance
  5. Smaller memory footprint