> On 29 Sep 2016, at 16:05, Roland King <r...@rols.org> wrote: > > >> On 29 Sep 2016, at 16:59, Gerriet M. Denkmann <g...@mdenkmann.de> wrote: >> >> >>> On 29 Sep 2016, at 15:34, Quincey Morris >>> <quinceymor...@rivergatesoftware.com> wrote: >>> >> >> Well, I count this as (bigArea = 4 GB): >> (a) one call of dispatch_apply which schedules 40 000 times a block to GCD >> which handles 0.1 MB >> (b) one call of dispatch_apply which schedules 8 times a block to GCD which >> handles 500 MB >> >> Could be that these blocks sometimes collide (maybe when they are operating >> on adjacent areas), which slows them down. Such a collision is rather >> unlikely if only 8 of 40 000 are running. > > Why guess - this is exactly what Instruments is designed to tell you. It’s > even dispatch-aware so it can show you results broken down by dispatch queue > and worker thread inside the dispatch queue. Run the two under instruments > and find out where all the time is spent.
Ok. So I did run the Time Profiler Instrument (as suggested by Quincey): dispatch_apply(8,…): My function is running 3090 msec and blocked 970 ms. Other blockings: 690 ms workq_kernreturn, 560 ms mach_msg_trap. And with dispatch_apply(20,000,…): My function is running 196 msec and blocked 27 ms. 21 ms workq_kernreturn, 34 ms mach_msg_trap. But I just cannot see anything which forces my function to run 16 times longer in the first case. Any ideas where to look for a reason? Kind regards, Gerriet. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com