Right now (without this change), Debug.Assert **always** formats its string parameters, even if doing so wouldn't be necessary because the condition is true. This has a huge impact on code that asserts frequently because it assumes that calling Assert(true, ...) is cheap.
public static void Assert (bool condition, string message,
string detailMessageFormat, params object [] args)
{
+ if (condition)
+ // Return early to avoid the string formatting
+ return;
+
TraceImpl.Assert (condition,
message,
string.Format (detailMessageFormat, args));