Re: why are conditional breakpoints SO SLOW?
Re: why are conditional breakpoints SO SLOW?
- Subject: Re: why are conditional breakpoints SO SLOW?
- From: email@hidden (Stefan Haller)
- Date: Tue, 18 Mar 2014 16:52:41 +0100
Roland King <email@hidden> wrote:
> I'm working on an OSX app. I have an issue 1,500,000 odd bytes into my
> file. A normal run gets there so fast you can't tell it's executing,
> fraction of a second.
>
> So I added a conditional breakpoint with the expression
>
> offset == 1512800 (the actual count I have the issue).
>
> The debug crawls. After about 5 minutes of running and a very hot laptop
> I'm at offset around 600,000, so I have another 8 or so minutes to go to
> get to where I usually fail in milliseconds.
>
> If I turn off that one conditional breakpoint, the code finishes (with the
> error) instantly. How can a trivial conditional breakpoint be this
> incredibly slow?
Whenever the debugger hits the breakpoint, it needs to stop, evaluate
the expression, see that it's false, and continue. This works well if
the breakpoint isn't hit very often, but if it is in a very tight loop,
it's going to be super slow.
The obvious workaround is to add an 'if' statement to your code, e.g.
like this:
if (offset == 1512800) {
int x = 42;
}
and then set a breakpoint on the 'int x' line.
--
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden