• 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: Mystery Threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mystery Threads


  • Subject: Re: Mystery Threads
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 29 Sep 2016 01:34:44 -0700
  • Feedback-id: 167118m:167118agrif8a:167118sPooMdzZJm:SMTPCORP

On Sep 29, 2016, at 01:05 , Gerriet M. Denkmann <email@hidden> wrote:
>
> Well, nothing. Just let’s call it nbrOfBlocksToBeUsedByDispatchApply, or whatever. But ultimately any of these things has to run on a CPU, of which there are no more than 8.

Well, here’s my narrative. It may be fiction or non-fiction.

You said you tried “nbrOf…” as a few ten-thousands, vs. 8. Let’s be concrete and call this (a) 40,000 vs. (b) 8. So, for each set of 40,000 iterations of your block, you’re doing 1 dispatch_apply in case #a, and 5,000 dispatch_apply calls in case #b. So, you’ve established that 4,999 dispatch_apply calls — and related per-dispatch_appy overhead — take a long time.

Of course, I’m relying on the fact that you’re doing the same number of *total* iterations of your inner loop in case #a and case #b. This is not quite the whole story, because there are loop setup overheads per block. However, the loop setup that you’ve shown is very simple — a couple of Int operations — so the additional 4,999 loop setup executions are likely dwarfed by 4,999 dispatch_apply executions.

>> Isn’t this what Instruments is for?
>
> Might be. I already looked at Time Profiler, but failed to notice anything (maybe was looking at the wrong things) and System Trace, but did not understand what to observe or what the Instrument was telling me.

Unfortunately, I agree, Instruments is inscrutable initially, and has a nasty learning curve. You kind of have to persist, poking around till things start to make a little sense. Since you want to know where time is being spent, Time Profiler sounds like the right place to start.

One possible approach is to profile case #a and case #b, and compare the Instruments output. Since you know what the actual performance difference is (in general terms), you should be able to see that reflected in what Instruments tells you. That should give you some reference points.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Mystery Threads
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >Mystery Threads (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Mystery Threads (From: Quincey Morris <email@hidden>)
 >Re: Mystery Threads (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: Mystery Threads
  • Next by Date: Re: Mystery Threads
  • Previous by thread: Re: Mystery Threads
  • Next by thread: Re: Mystery Threads
  • Index(es):
    • Date
    • Thread