I am attempting to debug a program in VS2010 using a breakpoint with a boolean condition. This particular breakpoint is painfully slow, making my program run hundreds of times slower than without the condition or using a regular unconditioned breakpoint.
My question is, is this a common issue with visual studio, I can't believe the debugger can be this slow? The boolean expression is very simple, it simply says break the program when i == x inside a for loop.
Any help appreciated as it's making debugging very painful.
Thanks Richard
public static RawNetCalculationResults newCATXLNets(IList<Loss> RawLosses, IList<ReinsuranceProgramme> Programme) //Loss contains the properties Year, EventID, Loss Value
{
List<Recoveries> NetRawLosses = new List<Recoveries>(RawLosses.Count * Programme.Count); //Initiate list with required capacity
//Loop over each element in RawLosses List and do some calculations
foreach (var e in RawLosses)
{ //<----BREAK POINT HERE (e.Year == x)
foreach (var layer in Programme.Where(x => x.Type == ReinsuranceType.CATXL))
{
Yes, conditional breakpoints are slow.
As an alternative, you can use Debug.Assert:
Debug.Assert( i != x );
This will cause the assert to fire when i == x
and you can debug from there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With