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

Re: NSOperation Efficiency


  • Subject: Re: NSOperation Efficiency
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Wed, 05 Dec 2012 14:02:50 +0700

On 5 Dec 2012, at 11:41, Kyle Sluder <email@hidden> wrote:

>
> On Dec 4, 2012, at 8:00 PM, Jens Alfke <email@hidden> wrote:
>
>>
>> On Dec 4, 2012, at 7:33 PM, Kyle Sluder <email@hidden> wrote:
>>
>>> Yeah, it sounds like you're saturating the thread pool due to
>>> non-CPU-bound operations. NSOpQ is going to spend its entire time
>>> spawning and switching to threads while you append more and more
>>> operations to the queue.

I made a test project with this Operation:

@implementation GmdOperationBasis
- (void)main
{
	if ( [ self isCancelled ] ) return;
	double sum = 8;
	for( NSUInteger i = 0; i < 13383333; i++ )	//	takes about 100 msec.
	{
		if ( [ self isCancelled ] ) return;
		double j = (double)i;
		sum += sqrt(j);
	};
}
@end

And got almost the same overhead (tested three times with 99 operations);
	clock time per operation	expected time	overhead factor
//	8 ops  	29.9, 30.1, 29.7		12.5			2.4
//	7 ops  	29.2, 30.0, 29.7		14.3			2.1
//	6 ops  	28.8, 28.5, 29.0		16.7			1.7
//	5 ops  	28.6, 28.4, 28.9		20				1.4
//	4 ops  	29.4, 31.9, 30.8		25				1.2
//	3 ops  	35.7, 35.4, 35.2		33				1.06
//	2 ops 	51.7, 51.5, 51.2		50				1.03
//	1 ops 	100

Looks like NSOperationQueue has some problems, or?

Kind regards,

Gerriet.

_______________________________________________

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: NSOperation Efficiency
      • From: Quincey Morris <email@hidden>
References: 
 >NSOperation Efficiency (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: NSOperation Efficiency (From: Kyle Sluder <email@hidden>)
 >Re: NSOperation Efficiency (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: NSOperation Efficiency (From: Kyle Sluder <email@hidden>)
 >Re: NSOperation Efficiency (From: Jens Alfke <email@hidden>)
 >Re: NSOperation Efficiency (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Arc and **
  • Next by Date: Re: Operations Beachball
  • Previous by thread: Re: NSOperation Efficiency
  • Next by thread: Re: NSOperation Efficiency
  • Index(es):
    • Date
    • Thread