• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: why are conditional breakpoints SO SLOW?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: why are conditional breakpoints SO SLOW?


  • Subject: RE: why are conditional breakpoints SO SLOW?
  • From: "Dallman, John" <email@hidden>
  • Date: Tue, 18 Mar 2014 15:43:49 +0000
  • Thread-topic: why are conditional breakpoints SO SLOW?

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

Sadly, that is quite easy. The way conditional breakpoints work is that the breakpoint
instruction is put into the code, and the app starts. Each time the breakpoint is hit,
it is looked up, found to be a conditional breakpoint, expression is evaluated, and
found to be false, the count is incremented, the replaced instruction is run, and then
the app is resumed. This is happening 1.5 million times.

You can do this much more efficiently by changing your code a little: put something
like this in the code for the loop over the bytes:

if( offset == 1512800)
 {
  ((write some code to print something in a way suitable to your app))
 }

then set your breakpoint on the code in the block. This will run much faster, because
it does the counting in the app code, without having to trap into the debugger and
do interpreted stuff there.

--
John Dallman

-----------------
Siemens Industry Software Limited is a limited company registered in England and Wales.
Registered number: 3476850.
Registered office: Faraday House, Sir William Siemens Square, Frimley, Surrey, GU16 8QD.

 _______________________________________________
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


  • Follow-Ups:
    • Re: why are conditional breakpoints SO SLOW?
      • From: Roland King <email@hidden>
    • Re: why are conditional breakpoints SO SLOW?
      • From: Quincey Morris <email@hidden>
    • Re: why are conditional breakpoints SO SLOW?
      • From: Jens Alfke <email@hidden>
References: 
 >why are conditional breakpoints SO SLOW? (From: Roland King <email@hidden>)

  • Prev by Date: why are conditional breakpoints SO SLOW?
  • Next by Date: Re: why are conditional breakpoints SO SLOW?
  • Previous by thread: why are conditional breakpoints SO SLOW?
  • Next by thread: Re: why are conditional breakpoints SO SLOW?
  • Index(es):
    • Date
    • Thread